diff options
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 27 | ||||
-rw-r--r-- | Source/CMakeVersionCompute.cmake | 29 | ||||
-rw-r--r-- | Utilities/Doxygen/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Utilities/Sphinx/CMakeLists.txt | 2 |
5 files changed, 30 insertions, 33 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5efa077..75ac8bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -626,8 +626,7 @@ endif() # The main section of the CMakeLists file # #----------------------------------------------------------------------- -# Compute CMake_VERSION, etc. -include(Source/CMakeVersionCompute.cmake) +include(Source/CMakeVersion.cmake) # Include the standard Dart testing module enable_testing() diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index ea3b43a..08d3169 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -3,3 +3,30 @@ set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 15) set(CMake_VERSION_PATCH 20190726) #set(CMake_VERSION_RC 0) + +# Releases define a small patch level. +if("${CMake_VERSION_PATCH}" VERSION_LESS 20000000) + set(CMake_VERSION_IS_DIRTY 0) + set(CMake_VERSION_IS_RELEASE 1) + set(CMake_VERSION_SOURCE "") +else() + set(CMake_VERSION_IS_DIRTY 0) # may be set to 1 by CMakeVersionSource + set(CMake_VERSION_IS_RELEASE 0) + include(${CMake_SOURCE_DIR}/Source/CMakeVersionSource.cmake) +endif() + +# Compute the full version string. +set(CMake_VERSION ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}) +if(CMake_VERSION_SOURCE) + set(CMake_VERSION_SUFFIX "${CMake_VERSION_SOURCE}") +elseif(DEFINED 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() +if(CMake_VERSION_IS_DIRTY) + set(CMake_VERSION ${CMake_VERSION}-dirty) +endif() diff --git a/Source/CMakeVersionCompute.cmake b/Source/CMakeVersionCompute.cmake deleted file mode 100644 index 136851c..0000000 --- a/Source/CMakeVersionCompute.cmake +++ /dev/null @@ -1,29 +0,0 @@ -# Load version number components. -include(${CMake_SOURCE_DIR}/Source/CMakeVersion.cmake) - -# Releases define a small patch level. -if("${CMake_VERSION_PATCH}" VERSION_LESS 20000000) - set(CMake_VERSION_IS_DIRTY 0) - set(CMake_VERSION_IS_RELEASE 1) - set(CMake_VERSION_SOURCE "") -else() - set(CMake_VERSION_IS_DIRTY 0) # may be set to 1 by CMakeVersionSource - set(CMake_VERSION_IS_RELEASE 0) - include(${CMake_SOURCE_DIR}/Source/CMakeVersionSource.cmake) -endif() - -# Compute the full version string. -set(CMake_VERSION ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}) -if(CMake_VERSION_SOURCE) - set(CMake_VERSION_SUFFIX "${CMake_VERSION_SOURCE}") -elseif(DEFINED 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() -if(CMake_VERSION_IS_DIRTY) - set(CMake_VERSION ${CMake_VERSION}-dirty) -endif() diff --git a/Utilities/Doxygen/CMakeLists.txt b/Utilities/Doxygen/CMakeLists.txt index ce4cfaf..f52caed 100644 --- a/Utilities/Doxygen/CMakeLists.txt +++ b/Utilities/Doxygen/CMakeLists.txt @@ -7,7 +7,7 @@ if(NOT CMake_SOURCE_DIR) get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH) get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH) include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake) - include(${CMake_SOURCE_DIR}/Source/CMakeVersionCompute.cmake) + include(${CMake_SOURCE_DIR}/Source/CMakeVersion.cmake) include(${CMake_SOURCE_DIR}/Source/CMakeInstallDestinations.cmake) unset(CMAKE_DATA_DIR) unset(CMAKE_DATA_DIR CACHE) diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt index e4e6e05..736a7c0 100644 --- a/Utilities/Sphinx/CMakeLists.txt +++ b/Utilities/Sphinx/CMakeLists.txt @@ -7,7 +7,7 @@ if(NOT CMake_SOURCE_DIR) get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH) get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH) include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake) - include(${CMake_SOURCE_DIR}/Source/CMakeVersionCompute.cmake) + include(${CMake_SOURCE_DIR}/Source/CMakeVersion.cmake) include(${CMake_SOURCE_DIR}/Source/CMakeInstallDestinations.cmake) unset(CMAKE_DATA_DIR) unset(CMAKE_DATA_DIR CACHE) |