Skip to content

Commit 7a56490

Browse files
committed
Add additional replacement variables in generated version header and make macro names specific to the package
1 parent 13d9ceb commit 7a56490

5 files changed

Lines changed: 12 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Because YggdrasilRapidJSON continues to merge updates from RapidJSON, the RapidJ
55

66
## X.X.X.X - XXXX-XX-XX
77

8+
## 1.1.0.4 - 2026-05-XX
9+
810
### Bug fixes
911
* Fix bug where version could not be set in the conda recipe build since it is created from a tar instead of the git repo
1012

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/YggdrasilRapidJSONMacros.cmake)
2020
set(YGGDRASIL_RAPIDJSON_VERSION "" CACHE STRING "Version to use instead of the git tag version")
2121

2222
if(NOT YGGDRASIL_RAPIDJSON_VERSION)
23-
gitversion(YGGDRASIL_RAPIDJSON_VERSION "1.1.0.2")
23+
yggdrasil_rapidjson_gitversion(YGGDRASIL_RAPIDJSON_VERSION "1.1.0.2")
2424
endif()
2525
message(STATUS "YGGDRASIL_RAPIDJSON_VERSION = ${YGGDRASIL_RAPIDJSON_VERSION}")
2626

@@ -268,7 +268,7 @@ SET(CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" CACHE PATH "The directory cmake fi
268268
# ===============================
269269

270270
# Version header
271-
generate_version_header(
271+
yggdrasil_rapidjson_version_header(
272272
${PROJECT_NAME_UPPER}
273273
${PROJECT_VERSION}
274274
${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME_LOWER}/${PROJECT_NAME_LOWER}_version.h.in

YggdrasilRapidJSONMacros.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ macro(yggdrasil_rapidjson_options_config OUTPUT_PREFIX)
148148

149149
endmacro()
150150

151-
macro(gitversion OUTPUT_VARIABLE DEFAULT)
151+
macro(yggdrasil_rapidjson_gitversion OUTPUT_VARIABLE DEFAULT)
152152
find_package(Git)
153153
if(NOT Git_FOUND)
154154
message(STATUS "Failed to find Git cmake package, falling back to version ${DEFAULT}")
@@ -182,7 +182,7 @@ macro(gitversion OUTPUT_VARIABLE DEFAULT)
182182
endif()
183183
endmacro()
184184

185-
function(generate_version_header MACRO_PREFIX VERSION_STRING SRC DST)
185+
function(yggdrasil_rapidjson_version_header MACRO_PREFIX VERSION_STRING SRC DST)
186186
set(rem ${VERSION_STRING})
187187
set(idx 0)
188188
set(parts)

include/yggdrasil_rapidjson/yggdrasil_rapidjson_version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#define YGGDRASIL_RAPIDJSON_MAJOR_VERSION 1
3737
#define YGGDRASIL_RAPIDJSON_MINOR_VERSION 1
3838
#define YGGDRASIL_RAPIDJSON_PATCH_VERSION 0
39-
#define YGGDRASIL_RAPIDJSON_EXTEN_VERSION 3
39+
#define YGGDRASIL_RAPIDJSON_EXTEN_VERSION 4
4040
#define YGGDRASIL_RAPIDJSON_VERSION_STRING \
4141
YGGDRASIL_RAPIDJSON_STRINGIFY(YGGDRASIL_RAPIDJSON_MAJOR_VERSION.YGGDRASIL_RAPIDJSON_MINOR_VERSION.YGGDRASIL_RAPIDJSON_PATCH_VERSION.YGGDRASIL_RAPIDJSON_EXTEN_VERSION)
4242

include/yggdrasil_rapidjson/yggdrasil_rapidjson_version.h.in

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
///////////////////////////////////////////////////////////////////////////////
2-
// YGGDRASIL_RAPIDJSON_VERSION_STRING
2+
// @MACRO_PREFIX@_VERSION_STRING
33
//
44
#ifndef @MACRO_PREFIX@_VERSION_H_
55
#define @MACRO_PREFIX@_VERSION_H_
@@ -13,21 +13,21 @@
1313
/*! \def @MACRO_PREFIX@_MAJOR_VERSION
1414
\ingroup @MACRO_PREFIX@_CONFIG
1515
\brief Major version of RapidJSON in integer
16-
that this version of YggdrasilRapidJSON is based on.
16+
that this version of @PROJECT_NAME@ is based on.
1717
*/
1818
/*! \def @MACRO_PREFIX@_MINOR_VERSION
1919
\ingroup @MACRO_PREFIX@_CONFIG
2020
\brief Minor version of RapidJSON in integer
21-
that this version of YggdrasilRapidJSON is based on.
21+
that this version of @PROJECT_NAME@ is based on.
2222
*/
2323
/*! \def @MACRO_PREFIX@_PATCH_VERSION
2424
\ingroup @MACRO_PREFIX@_CONFIG
2525
\brief Patch version of RapidJSON in integer
26-
that this version of YggdrasilRapidJSON is based on.
26+
that this version of @PROJECT_NAME@ is based on.
2727
*/
2828
/*! \def @MACRO_PREFIX@_EXTEN_VERSION
2929
\ingroup @MACRO_PREFIX@_CONFIG
30-
\brief Version of YggdrasilRapidJSON based on RapidJSON.
30+
\brief Version of @PROJECT_NAME@ based on RapidJSON.
3131
*/
3232
/*! \def @MACRO_PREFIX@_VERSION_STRING
3333
\ingroup @MACRO_PREFIX@_CONFIG

0 commit comments

Comments
 (0)