feat: use CMake to generate library version info.
- use CMake to produce YYCC version header when configuring.
This commit is contained in:
parent
831fa130bc
commit
0b7e58c8e8
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,5 +1,6 @@
|
|||
# -------------------- Output --------------------
|
||||
out/
|
||||
src/YYCC/YYCCVersion.hpp
|
||||
CMakeSettings.json
|
||||
|
||||
# -------------------- VSCode --------------------
|
||||
|
|
5
cmake/YYCCVersion.hpp.in
Normal file
5
cmake/YYCCVersion.hpp.in
Normal file
|
@ -0,0 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#define YYCC_VER_MAJOR @PROJECT_VERSION_MAJOR@
|
||||
#define YYCC_VER_MINOR @PROJECT_VERSION_MINOR@
|
||||
#define YYCC_VER_PATCH @PROJECT_VERSION_PATCH@
|
|
@ -1,3 +1,10 @@
|
|||
# Configure version file
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_LIST_DIR}/../cmake/YYCCVersion.hpp.in
|
||||
${CMAKE_CURRENT_LIST_DIR}/YYCC/YYCCVersion.hpp
|
||||
@ONLY
|
||||
)
|
||||
|
||||
# Create static library
|
||||
add_library(YYCCommonplace STATIC "")
|
||||
# Setup static library sources
|
||||
|
@ -42,6 +49,7 @@ FILES
|
|||
YYCC/WinImportPrefix.hpp
|
||||
YYCC/WinImportSuffix.hpp
|
||||
# Internal
|
||||
YYCC/YYCCVersion.hpp
|
||||
YYCC/YYCCInternal.hpp
|
||||
# Exposed
|
||||
YYCCommonplace.hpp
|
||||
|
|
|
@ -2,9 +2,7 @@
|
|||
|
||||
#pragma region Library Version and Comparison Macros
|
||||
|
||||
#define YYCC_VER_MAJOR 1
|
||||
#define YYCC_VER_MINOR 3
|
||||
#define YYCC_VER_PATCH 0
|
||||
#include "YYCCVersion.hpp"
|
||||
|
||||
/// @brief Return true if left version number is equal to right version number, otherwise false.
|
||||
#define YYCC_VERCMP_E(av1, av2, av3, bv1, bv2, bv3) ((av1) == (bv1) && (av2) == (bv2) && (av3) == (bv3))
|
||||
|
|
Loading…
Reference in New Issue
Block a user