Make CMake version suffix available to code
Make the string (e.g. "rc1" or "gSHA-dirty") available to the code.
This commit is contained in:
parent
7af4bc69c5
commit
6a077b5d63
|
@ -12,9 +12,13 @@ endif()
|
|||
|
||||
# Compute the full version string.
|
||||
set(CMake_VERSION ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH})
|
||||
if(CMake_VERSION_RC)
|
||||
set(CMake_VERSION ${CMake_VERSION}-rc${CMake_VERSION_RC})
|
||||
endif()
|
||||
if(CMake_VERSION_SOURCE)
|
||||
set(CMake_VERSION ${CMake_VERSION}-${CMake_VERSION_SOURCE})
|
||||
set(CMake_VERSION_SUFFIX "${CMake_VERSION_SOURCE}")
|
||||
elseif(CMake_VERSION_RC)
|
||||
set(CMake_VERSION_SUFFIX "rc${CMake_VERSION_RC}")
|
||||
else()
|
||||
set(CMake_VERSION_SUFFIX "")
|
||||
endif()
|
||||
if(CMake_VERSION_SUFFIX)
|
||||
set(CMake_VERSION ${CMake_VERSION}-${CMake_VERSION_SUFFIX})
|
||||
endif()
|
||||
|
|
|
@ -12,4 +12,5 @@
|
|||
#define CMake_VERSION_MAJOR @CMake_VERSION_MAJOR@
|
||||
#define CMake_VERSION_MINOR @CMake_VERSION_MINOR@
|
||||
#define CMake_VERSION_PATCH @CMake_VERSION_PATCH@
|
||||
#define CMake_VERSION_SUFFIX "@CMake_VERSION_SUFFIX@"
|
||||
#define CMake_VERSION "@CMake_VERSION@"
|
||||
|
|
Loading…
Reference in New Issue