diff options
author | Brad King <brad.king@kitware.com> | 2003-02-14 02:57:05 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2003-02-14 02:57:05 (GMT) |
commit | 1fe42129d43d659f33ed72e63c26e7c9f8cf64d9 (patch) | |
tree | 14e46cb1e8dbb31338cf4fa0ed6f937a218ccb9c /Source | |
parent | 170fe935d2cdcbfd02e4385a3ca5abf3bf4b4192 (diff) | |
download | CMake-1fe42129d43d659f33ed72e63c26e7c9f8cf64d9.zip CMake-1fe42129d43d659f33ed72e63c26e7c9f8cf64d9.tar.gz CMake-1fe42129d43d659f33ed72e63c26e7c9f8cf64d9.tar.bz2 |
ENH: Centralized setting of CMake version number to top-level CMake listfile.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Source/WXDialog/CMakeLists.txt | 8 | ||||
-rw-r--r-- | Source/cmConfigure.cmake.h.in | 5 | ||||
-rw-r--r-- | Source/cmConfigure.h.in | 3 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 9 | ||||
-rw-r--r-- | Source/cmMakefile.h | 6 | ||||
-rw-r--r-- | Source/cmStandardIncludes.h | 8 |
7 files changed, 30 insertions, 11 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index b69fde5..0c83d53 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -309,8 +309,6 @@ IF(BUILD_TESTING) ENDIF (APPLE) ENDIF(BUILD_TESTING) - - INCLUDE (${CMAKE_BINARY_DIR}/Source/LocalUserOptions.cmake OPTIONAL) INCLUDE (${CMAKE_SOURCE_DIR}/Source/LocalUserOptions.cmake OPTIONAL) diff --git a/Source/WXDialog/CMakeLists.txt b/Source/WXDialog/CMakeLists.txt index 2438e16..ada99de 100644 --- a/Source/WXDialog/CMakeLists.txt +++ b/Source/WXDialog/CMakeLists.txt @@ -29,12 +29,12 @@ IF ( CMAKE_WX_CAN_COMPILE ) IF(APPLE) SET(APPLE_GUI_EXECUTABLE wxCMakeSetup) - SET(APPLE_GUI_INFO_STRING "CMake version 1.7.0, (c) 2003 Kitware Inc.") + SET(APPLE_GUI_INFO_STRING "CMake version ${CMake_VERSION_MAJOR}, (c) 2003 Kitware Inc.") SET(APPLE_GUI_IDENTIFIER "com.kitware.wxCMakeSetup") - SET(APPLE_GUI_LONG_VERSION_STRING "1.7.0, (c) 2003 Kitware Inc.") + SET(APPLE_GUI_LONG_VERSION_STRING "${CMake_VERSION_MAJOR}, (c) 2003 Kitware Inc.") SET(APPLE_GUI_BUNDLE_NAME "CMake") - SET(APPLE_GUI_SHORT_VERSION_STRING "1.7.0") - SET(APPLE_GUI_BUNDLE_VERSION "1.7.0") + SET(APPLE_GUI_SHORT_VERSION_STRING "${CMake_VERSION_MAJOR}") + SET(APPLE_GUI_BUNDLE_VERSION "${CMake_VERSION_MAJOR}") SET(APPLE_GUI_ICON "CMakeIcon.icns") SET(APPLE_GUI_COPYRIGHT "Copyright 2002 Kitware Inc.") CONFIGURE_FILE(${CMake_SOURCE_DIR}/Templates/AppleInfo.plist diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in index ffff9e0..8f1ec76 100644 --- a/Source/cmConfigure.cmake.h.in +++ b/Source/cmConfigure.cmake.h.in @@ -6,5 +6,6 @@ #define CMAKE_BUILD_DIR "${CMake_BINARY_DIR}" #define CMAKE_PREFIX "${CMAKE_INSTALL_PREFIX}" - - +#define CMake_VERSION_MAJOR @CMake_VERSION_MAJOR@ +#define CMake_VERSION_MINOR @CMake_VERSION_MINOR@ +#define CMake_VERSION_PATCH @CMake_VERSION_PATCH@ diff --git a/Source/cmConfigure.h.in b/Source/cmConfigure.h.in index bff2d77..ba4db57 100644 --- a/Source/cmConfigure.h.in +++ b/Source/cmConfigure.h.in @@ -3,3 +3,6 @@ #undef CMAKE_NO_ANSI_STRING_STREAM #undef CMAKE_NO_ANSI_FOR_SCOPE +#undef CMake_VERSION_MAJOR +#undef CMake_VERSION_MINOR +#undef CMake_VERSION_PATCH diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 7143f59..b386041 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -57,6 +57,15 @@ cmMakefile::cmMakefile() this->AddDefaultDefinitions(); } +const char* cmMakefile::GetReleaseVersion() +{ +#if CMake_VERSION_MINOR & 1 + return "development"; +#else + return "patch " CMAKE_TO_STRING(CMake_VERSION_PATCH); +#endif +} + unsigned int cmMakefile::GetCacheMajorVersion() { if(!this->GetCacheManager()->GetCacheValue("CMAKE_CACHE_MAJOR_VERSION")) diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index e472781..2b7d91f 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -46,9 +46,9 @@ public: /** * Return major and minor version numbers for cmake. */ - static unsigned int GetMajorVersion() { return 1;} - static unsigned int GetMinorVersion() { return 7;} - static const char *GetReleaseVersion() { return "development";} + static unsigned int GetMajorVersion() { return CMake_VERSION_MAJOR; } + static unsigned int GetMinorVersion() { return CMake_VERSION_MINOR; } + static const char* GetReleaseVersion(); /** * Return the major and minor version of the cmake that diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index ceab7fc..937d9c2 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -21,12 +21,20 @@ #ifndef cmStandardIncludes_h #define cmStandardIncludes_h +#define CMAKE_TO_STRING(x) CMAKE_TO_STRING0(x) +#define CMAKE_TO_STRING0(x) #x + // include configure generated header to define // CMAKE_NO_ANSI_STREAM_HEADERS and CMAKE_NO_STD_NAMESPACE #if defined(CMAKE_HAS_AUTOCONF) || defined(CMAKE_BUILD_WITH_CMAKE) #include "cmConfigure.h" #endif +#define CMake_VERSION_STRING \ + CMAKE_TO_STRING(CMake_VERSION_MAJOR) "." \ + CMAKE_TO_STRING(CMake_VERSION_MINOR) "." \ + CMAKE_TO_STRING(CMake_VERSION_PATCH) + #ifdef _MSC_VER #pragma warning ( disable : 4786 ) #pragma warning ( disable : 4503 ) |