diff options
author | Brad King <brad.king@kitware.com> | 2009-03-05 15:17:07 -0500 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-03-05 15:17:07 -0500 |
commit | 98c51ff6dcd5e6aa80050cfc00f19eb6092e79c0 (patch) | |
tree | 8aabdbd5936493a3808cf1184620ebf08ef1d8ff /Source/cmVersionMacros.h | |
parent | 83f39ba41b2c8969db2b44761d5fed363dc170b5 (diff) | |
download | cmake-98c51ff6dcd5e6aa80050cfc00f19eb6092e79c0.tar.gz |
ENH: Overhaul CMake version numbering
This moves the version numbers into an isolated configured header so
that not all of CMake needs to rebuild when the version changes.
Previously we had spaces, dashes and/or the word 'patch' randomly chosen
before the patch number. Now we always report version numbers in the
traditional format "<major>.<minor>.<patch>[-rc<rc>]".
We still use odd minor numbers for development versions. Now we also
use the CCYYMMDD date as the patch number of development versions, thus
allowing tests for exact CMake versions.
Diffstat (limited to 'Source/cmVersionMacros.h')
-rw-r--r-- | Source/cmVersionMacros.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/Source/cmVersionMacros.h b/Source/cmVersionMacros.h new file mode 100644 index 0000000000..aaaa4e37fb --- /dev/null +++ b/Source/cmVersionMacros.h @@ -0,0 +1,40 @@ +/*========================================================================= + + Program: CMake - Cross-Platform Makefile Generator + Module: $RCSfile$ + Language: C++ + Date: $Date$ + Version: $Revision$ + + Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef cmVersionMacros_h +#define cmVersionMacros_h + +#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 "" +#endif + +#endif |