diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2022-05-20 20:56:04 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2022-06-19 18:53:01 +0900 |
commit | 11a6934bbb70fd1dde99b77afcec2855c69699b6 (patch) | |
tree | f60dd7e8bbc48a02dde4f165c927a7f9f29fe4dd | |
parent | 0560f24a3be03514a9a020f589b6255ce8a5fd86 (diff) | |
download | tde-cmake-11a6934bbb70fd1dde99b77afcec2855c69699b6.tar.gz tde-cmake-11a6934bbb70fd1dde99b77afcec2855c69699b6.zip |
Add macro to set project version at TDE-wide scope.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
-rw-r--r-- | modules/TDEMacros.cmake | 1 | ||||
-rw-r--r-- | modules/TDEVersion.cmake | 29 |
2 files changed, 30 insertions, 0 deletions
diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake index 9b46b84..440088c 100644 --- a/modules/TDEMacros.cmake +++ b/modules/TDEMacros.cmake @@ -16,6 +16,7 @@ ################################################# include( CheckCXXCompilerFlag ) +include( TDEVersion ) ################################################# diff --git a/modules/TDEVersion.cmake b/modules/TDEVersion.cmake new file mode 100644 index 0000000..a222152 --- /dev/null +++ b/modules/TDEVersion.cmake @@ -0,0 +1,29 @@ +################################################# +# +# (C) 2022 Michele Calgaro +# michele (DOT) calgaro (AT) yahoo (DOT) it +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +################################################# +##### +##### tde_set_project_version + +macro( tde_set_project_version ) + + set( DEFAULT_VERSION "R14.1.0~[DEVELOPMENT]" ) + + unset( VERSION ) + + file( STRINGS ${CMAKE_SOURCE_DIR}/.tdescminfo VERSION_STRING REGEX "^Version:.+$" ) + string( REGEX REPLACE "^Version: (R[0-9]+\.[0-9]+\.[0-9]+.*)$" "\\1" VERSION "${VERSION_STRING}" ) + if( NOT VERSION ) + set( VERSION "${DEFAULT_VERSION}" ) + endif() + +endmacro( ) + |