summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2007-09-07 18:20:14 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2007-09-07 18:20:14 (GMT)
commitde46b1c29833330d0c0f704e1af842a0c51618be (patch)
tree7466be0778c8dc3054e20d3e2c16afe08280bc5d /CMakeLists.txt
parent30ad13be942dae768d6c3e8f1ab21e9e9568f966 (diff)
downloadCMake-de46b1c29833330d0c0f704e1af842a0c51618be.zip
CMake-de46b1c29833330d0c0f704e1af842a0c51618be.tar.gz
CMake-de46b1c29833330d0c0f704e1af842a0c51618be.tar.bz2
ENH: for CVS CMake have cpack use the version date in the name of the package
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt16
1 files changed, 16 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 89bbc54..a5030e3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -345,6 +345,22 @@ ENDMACRO (CMAKE_BUILD_UTILITIES)
SET(CMake_VERSION_MAJOR 2)
SET(CMake_VERSION_MINOR 5)
SET(CMake_VERSION_PATCH 0)
+
+# CVS versions are odd, if this is an odd minor version
+# then set the CMake_VERSION_DATE variable
+MATH(EXPR OUT "${CMake_VERSION_MINOR} & 1")
+IF(OUT EQUAL 1)
+ # extract the version Date from the cmVersion.cxx file
+ FILE(READ "${CMake_SOURCE_DIR}/Source/cmVersion.cxx"
+ CMAKE_VERSION_FILE_CONTENT)
+ STRING(REGEX MATCH "\\$Date: ([^ ]*) "
+ CMake_VERSION_DATE "${CMAKE_VERSION_FILE_CONTENT}")
+ STRING(REGEX REPLACE "\\$Date: ([^ ]*) " "\\1"
+ CMake_VERSION_DATE "${CMake_VERSION_DATE}")
+ STRING(REPLACE "/" "" CMake_VERSION_DATE
+ "${CMake_VERSION_DATE}")
+ENDIF(OUT EQUAL 1)
+
SET(CMake_VERSION "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
SET(CMake_VERSION_FULL "${CMake_VERSION}.${CMake_VERSION_PATCH}")