summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
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}")