diff options
author | Brad King <brad.king@kitware.com> | 2019-07-23 20:41:29 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-07-29 15:25:43 (GMT) |
commit | ecdf38aa36cfcc897e585ba05fd6f6e738bb5157 (patch) | |
tree | 9bd4380d4a444b5e8303c43bfdc38debaa2db385 | |
parent | 8cf4aec5acc2a3a10abbbbbde17c18d96a97e139 (diff) | |
download | CMake-ecdf38aa36cfcc897e585ba05fd6f6e738bb5157.zip CMake-ecdf38aa36cfcc897e585ba05fd6f6e738bb5157.tar.gz CMake-ecdf38aa36cfcc897e585ba05fd6f6e738bb5157.tar.bz2 |
CMakeVersion: Move computation logic to main script
-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) |