summaryrefslogtreecommitdiff
path: root/Modules/CMakeCCompiler.cmake.in
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-12-05 09:44:09 -0500
committerBrad King <brad.king@kitware.com>2011-12-07 08:59:51 -0500
commitfa7141f5ad9bc084fefbb898c6cdda9312c5f615 (patch)
treee5e6c65bb884260c99ce1a00221848911c97378a /Modules/CMakeCCompiler.cmake.in
parente0bc42aa4ff086e9c6976ab91ba924530df0bf72 (diff)
downloadcmake-fa7141f5ad9bc084fefbb898c6cdda9312c5f615.tar.gz
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 'Modules/CMakeCCompiler.cmake.in')
-rw-r--r--Modules/CMakeCCompiler.cmake.in1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in
index 04a5cec6d6..b14cf3427d 100644
--- a/Modules/CMakeCCompiler.cmake.in
+++ b/Modules/CMakeCCompiler.cmake.in
@@ -1,6 +1,7 @@
SET(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@")
SET(CMAKE_C_COMPILER_ARG1 "@CMAKE_C_COMPILER_ARG1@")
SET(CMAKE_C_COMPILER_ID "@CMAKE_C_COMPILER_ID@")
+SET(CMAKE_C_COMPILER_VERSION "@CMAKE_C_COMPILER_VERSION@")
SET(CMAKE_C_PLATFORM_ID "@CMAKE_C_PLATFORM_ID@")
@SET_MSVC_C_ARCHITECTURE_ID@
SET(CMAKE_AR "@CMAKE_AR@")