summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt29
-rw-r--r--Source/cmDocumentVariables.cxx14
-rw-r--r--Source/cmMakefile.cxx8
-rw-r--r--Source/cmVersion.cxx3
-rw-r--r--Source/cmVersion.h1
-rw-r--r--Source/cmVersionConfig.h.in3
-rw-r--r--Source/cmVersionMacros.h19
-rwxr-xr-xbootstrap25
8 files changed, 58 insertions, 44 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4cd11c4..f56beb3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -339,18 +339,29 @@ ENDMACRO (CMAKE_BUILD_UTILITIES)
SET(CMake_VERSION_MAJOR 2)
SET(CMake_VERSION_MINOR 9)
SET(CMake_VERSION_PATCH 0)
+#SET(CMake_VERSION_TWEAK 0)
-# We use odd minor numbers for development versions.
-# Use a date for the development patch level.
-IF("${CMake_VERSION_MINOR}" MATCHES "[13579]$")
+# Releases define a tweak level.
+IF(DEFINED CMake_VERSION_TWEAK)
+ SET(CMake_VERSION_IS_RELEASE 1)
+ELSE()
+ SET(CMake_VERSION_IS_RELEASE 0)
+
+ # Use the date as the tweak level.
INCLUDE(${CMake_SOURCE_DIR}/Source/kwsys/kwsysDateStamp.cmake)
- SET(CMake_VERSION_PATCH
+ SET(CMake_VERSION_TWEAK
"${KWSYS_DATE_STAMP_YEAR}${KWSYS_DATE_STAMP_MONTH}${KWSYS_DATE_STAMP_DAY}"
)
-ENDIF("${CMake_VERSION_MINOR}" MATCHES "[13579]$")
+ENDIF()
-SET(CMake_VERSION "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
-SET(CMake_VERSION_FULL "${CMake_VERSION}.${CMake_VERSION_PATCH}")
+# Compute the full version string.
+SET(CMake_VERSION ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH})
+IF(${CMake_VERSION_TWEAK} GREATER 0)
+ SET(CMake_VERSION ${CMake_VERSION}.${CMake_VERSION_TWEAK})
+ENDIF()
+IF(CMake_VERSION_RC)
+ SET(CMake_VERSION ${CMake_VERSION}-rc${CMake_VERSION_RC})
+ENDIF()
# Include the standard Dart testing module
ENABLE_TESTING()
@@ -370,9 +381,9 @@ SET(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL
# install tree.
SET(CMAKE_SKIP_RPATH ON CACHE INTERNAL "CMake does not need RPATHs.")
-SET(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION}" CACHE STRING
+SET(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" CACHE STRING
"Install location for data (relative to prefix).")
-SET(CMAKE_DOC_DIR "/doc/cmake-${CMake_VERSION}" CACHE STRING
+SET(CMAKE_DOC_DIR "/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" CACHE STRING
"Install location for documentation (relative to prefix).")
SET(CMAKE_MAN_DIR "/man" CACHE STRING
"Install location for man pages (relative to prefix).")
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index c6f9ba5..b583021 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -251,12 +251,20 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
" executable being run.",false,
"Variables that Provide Information");
cm->DefineProperty
+ ("CMAKE_TWEAK_VERSION", cmProperty::VARIABLE,
+ "The tweak version of cmake (i.e. the 1 in X.X.X.1).",
+ "This specifies the tweak version of the CMake executable being run. "
+ "Releases use tweak < 20000000 and development versions use the date "
+ "format CCYYMMDD for the tweak level."
+ ,false, "Variables that Provide Information");
+ cm->DefineProperty
("CMAKE_VERSION", cmProperty::VARIABLE,
- "The full version of cmake in major.minor.patch format.",
+ "The full version of cmake in major.minor.patch[.tweak] format.",
"This specifies the full version of the CMake executable being run. "
"This variable is defined by versions 2.6.3 and higher. "
- "See variables CMAKE_MAJOR_VERSION, CMAKE_MINOR_VERSION, and "
- "CMAKE_PATCH_VERSION for individual version components.", false,
+ "See variables CMAKE_MAJOR_VERSION, CMAKE_MINOR_VERSION, "
+ "CMAKE_PATCH_VERSION, and CMAKE_TWEAK_VERSION "
+ "for individual version components.", false,
"Variables that Provide Information");
cm->DefineProperty
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index d09188a..e51ee65 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2368,11 +2368,9 @@ void cmMakefile::AddDefaultDefinitions()
this->AddDefinition("CMAKE_MAJOR_VERSION", temp);
sprintf(temp, "%d", cmVersion::GetPatchVersion());
this->AddDefinition("CMAKE_PATCH_VERSION", temp);
- sprintf(temp, "%u.%u.%u",
- cmVersion::GetMajorVersion(),
- cmVersion::GetMinorVersion(),
- cmVersion::GetPatchVersion());
- this->AddDefinition("CMAKE_VERSION", temp);
+ sprintf(temp, "%d", cmVersion::GetTweakVersion());
+ this->AddDefinition("CMAKE_TWEAK_VERSION", temp);
+ this->AddDefinition("CMAKE_VERSION", cmVersion::GetCMakeVersion());
this->AddDefinition("CMAKE_FILES_DIRECTORY",
cmake::GetCMakeFilesDirectory());
diff --git a/Source/cmVersion.cxx b/Source/cmVersion.cxx
index bde5f98..047d24d 100644
--- a/Source/cmVersion.cxx
+++ b/Source/cmVersion.cxx
@@ -16,8 +16,9 @@
unsigned int cmVersion::GetMajorVersion() { return CMake_VERSION_MAJOR; }
unsigned int cmVersion::GetMinorVersion() { return CMake_VERSION_MINOR; }
unsigned int cmVersion::GetPatchVersion() { return CMake_VERSION_PATCH; }
+unsigned int cmVersion::GetTweakVersion() { return CMake_VERSION_TWEAK; }
const char* cmVersion::GetCMakeVersion()
{
- return CMake_VERSION_FULL CMake_VERSION_RC_SUFFIX;
+ return CMake_VERSION;
}
diff --git a/Source/cmVersion.h b/Source/cmVersion.h
index f267ab6..e313524 100644
--- a/Source/cmVersion.h
+++ b/Source/cmVersion.h
@@ -28,6 +28,7 @@ public:
static unsigned int GetMajorVersion();
static unsigned int GetMinorVersion();
static unsigned int GetPatchVersion();
+ static unsigned int GetTweakVersion();
static const char* GetCMakeVersion();
};
diff --git a/Source/cmVersionConfig.h.in b/Source/cmVersionConfig.h.in
index ee6eca7..76bc8fe 100644
--- a/Source/cmVersionConfig.h.in
+++ b/Source/cmVersionConfig.h.in
@@ -12,4 +12,5 @@
#define CMake_VERSION_MAJOR @CMake_VERSION_MAJOR@
#define CMake_VERSION_MINOR @CMake_VERSION_MINOR@
#define CMake_VERSION_PATCH @CMake_VERSION_PATCH@
-#cmakedefine CMake_VERSION_RC @CMake_VERSION_RC@
+#define CMake_VERSION_TWEAK @CMake_VERSION_TWEAK@
+#define CMake_VERSION "@CMake_VERSION@"
diff --git a/Source/cmVersionMacros.h b/Source/cmVersionMacros.h
index 412db6d..67f58ca 100644
--- a/Source/cmVersionMacros.h
+++ b/Source/cmVersionMacros.h
@@ -14,22 +14,9 @@
#include "cmVersionConfig.h"
-#define CMAKE_TO_STRING(x) CMAKE_TO_STRING0(x)
-#define CMAKE_TO_STRING0(x) #x
-
-#define CMake_VERSION \
- CMAKE_TO_STRING(CMake_VERSION_MAJOR) "." \
- CMAKE_TO_STRING(CMake_VERSION_MINOR)
-
-#define CMake_VERSION_FULL \
- CMAKE_TO_STRING(CMake_VERSION_MAJOR) "." \
- CMAKE_TO_STRING(CMake_VERSION_MINOR) "." \
- CMAKE_TO_STRING(CMake_VERSION_PATCH)
-
-#if !(CMake_VERSION_MINOR & 1) && defined(CMake_VERSION_RC)
-# define CMake_VERSION_RC_SUFFIX "-rc" CMAKE_TO_STRING(CMake_VERSION_RC)
-#else
-# define CMake_VERSION_RC_SUFFIX ""
+#define CMake_VERSION_TWEAK_IS_RELEASE(tweak) ((tweak) < 20000000)
+#if CMake_VERSION_TWEAK_IS_RELEASE(CMake_VERSION_TWEAK)
+# define CMake_VERSION_IS_RELEASE 1
#endif
#endif
diff --git a/bootstrap b/bootstrap
index bcd11a5..c018b3c 100755
--- a/bootstrap
+++ b/bootstrap
@@ -30,17 +30,22 @@ cmake_date_stamp_component()
cmake_system=`uname`
cmake_source_dir=`cd "\`dirname \"$0\"\`";pwd`
cmake_binary_dir=`pwd`
+
+# Load version information.
cmake_version_major="`cmake_version_component MAJOR`"
cmake_version_minor="`cmake_version_component MINOR`"
-if echo "${cmake_version_minor}" | grep "[0-9]*[13579]" > /dev/null 2>&1; then
- cmake_version_patch="`cmake_date_stamp_component YEAR``cmake_date_stamp_component MONTH``cmake_date_stamp_component DAY`"
-else
- cmake_version_patch="`cmake_version_component PATCH`"
+cmake_version_patch="`cmake_version_component PATCH`"
+cmake_version="${cmake_version_major}.${cmake_version_minor}.${cmake_version_patch}"
+cmake_version_tweak="`cmake_version_component TWEAK`"
+if [ "x$cmake_version_tweak" = "x" ]; then
+ cmake_version_tweak="`cmake_date_stamp_component YEAR``cmake_date_stamp_component MONTH``cmake_date_stamp_component DAY`"
fi
-cmake_version="${cmake_version_major}.${cmake_version_minor}"
-cmake_version_full="${cmake_version_major}.${cmake_version_minor}.${cmake_version_patch}"
-cmake_data_dir="/share/cmake-${cmake_version}"
-cmake_doc_dir="/doc/cmake-${cmake_version}"
+if [ "$cmake_version_tweak" != "0" ]; then
+ cmake_version="${cmake_version}.${cmake_version_tweak}"
+fi
+
+cmake_data_dir="/share/cmake-${cmake_version_major}.${cmake_version_minor}"
+cmake_doc_dir="/doc/cmake-${cmake_version_major}.${cmake_version_minor}"
cmake_man_dir="/man"
cmake_init_file=""
cmake_bootstrap_system_libs=""
@@ -312,7 +317,7 @@ Directory and file names:
# Display CMake bootstrap usage
cmake_version_display()
{
- echo "CMake ${cmake_version_full}, Copyright 2000-2009 Kitware, Inc."
+ echo "CMake ${cmake_version}, Copyright 2000-2009 Kitware, Inc."
}
# Display CMake bootstrap error, display the log file and exit
@@ -1246,6 +1251,8 @@ fi
cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_MAJOR ${cmake_version_major}"
cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_MINOR ${cmake_version_minor}"
cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_PATCH ${cmake_version_patch}"
+cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_TWEAK ${cmake_version_tweak}"
+cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION \"${cmake_version}\""
cmake_report cmConfigure.h${_tmp} "#define CMAKE_ROOT_DIR \"${cmake_root_dir}\""
cmake_report cmConfigure.h${_tmp} "#define CMAKE_DATA_DIR \"${cmake_data_dir}\""
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP"