diff options
author | Brad King <brad.king@kitware.com> | 2011-12-05 14:44:09 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2011-12-07 13:59:51 (GMT) |
commit | fa7141f5ad9bc084fefbb898c6cdda9312c5f615 (patch) | |
tree | e5e6c65bb884260c99ce1a00221848911c97378a /Source | |
parent | e0bc42aa4ff086e9c6976ab91ba924530df0bf72 (diff) | |
download | CMake-fa7141f5ad9bc084fefbb898c6cdda9312c5f615.zip CMake-fa7141f5ad9bc084fefbb898c6cdda9312c5f615.tar.gz CMake-fa7141f5ad9bc084fefbb898c6cdda9312c5f615.tar.bz2 |
Add framework to detect compiler version with its id (#12408)
Teach CMakePlatformId.h to construct an "INFO:compiler_version[]" string
literal from macros COMPILER_VERSION_(MAJOR|MINOR|PATCH|TWEAK) to be
defined in CMake(C|CXX)CompilerId.(c|cpp) for each compiler. Provide
conversion macros DEC() and HEX() to decode decimal or hex digits from
integer values. Parse the version out of the compiler id binary along
with the other INFO values already present.
Store the result in variable CMAKE_<LANG>_COMPILER_VERSION in the format
"major[.minor[.patch[.tweak]]]". Save the value persistently in
CMake(C|CXX)Compiler.cmake in the build tree. Document the variable for
internal use since we do not set it everywhere yet.
Report the compiler version on the compiler id result line e.g.
The C compiler identification is GNU 4.5.2
Report CMAKE_(C|CXX)_COMPILER_(ID|VERSION) in SystemInformation test.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmDocumentVariables.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index ed303c9..ad119ea 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -1279,6 +1279,15 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "Variables for Languages"); cm->DefineProperty + ("CMAKE_<LANG>_COMPILER_VERSION", cmProperty::VARIABLE, + "An internal variable subject to change.", + "Compiler version in major[.minor[.patch[.tweak]]] format. " + "This variable is reserved for internal use by CMake and is not " + "guaranteed to be set.", + false, + "Variables for Languages"); + + cm->DefineProperty ("CMAKE_INTERNAL_PLATFORM_ABI", cmProperty::VARIABLE, "An internal variable subject to change.", "This is used in determining the compiler ABI and is subject to change.", |