diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-04-23 09:00:28 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2014-05-07 12:00:01 (GMT) |
commit | 8896501b236258f6908a59eb81f49983892bdcff (patch) | |
tree | a68fc700ad4d22e48182529535e62c8eaf8c3ae0 /Modules | |
parent | 23f451bb33c384d19ec29934b2811e081ff3e685 (diff) | |
download | CMake-8896501b236258f6908a59eb81f49983892bdcff.zip CMake-8896501b236258f6908a59eb81f49983892bdcff.tar.gz CMake-8896501b236258f6908a59eb81f49983892bdcff.tar.bz2 |
CompilerId: Allow specifying a prefix for preprocessor defines.
Diffstat (limited to 'Modules')
21 files changed, 82 insertions, 79 deletions
diff --git a/Modules/CMakeCompilerIdDetection.cmake b/Modules/CMakeCompilerIdDetection.cmake index 13e420c..f0e39ad 100644 --- a/Modules/CMakeCompilerIdDetection.cmake +++ b/Modules/CMakeCompilerIdDetection.cmake @@ -39,6 +39,7 @@ function(compiler_id_detection outvar lang) endforeach() set(options ID_STRING VERSION_STRINGS ID_DEFINE PLATFORM_DEFAULT_COMPILER) + set(oneValueArgs PREFIX) cmake_parse_arguments(CID "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if (CID_UNPARSED_ARGUMENTS) message(FATAL_ERROR "Unrecognized arguments: \"${CID_UNPARSED_ARGUMENTS}\"") @@ -74,7 +75,7 @@ function(compiler_id_detection outvar lang) if(CID_ID_DEFINE) foreach(Id ${ordered_compilers}) - set(CMAKE_${lang}_COMPILER_ID_CONTENT "${CMAKE_${lang}_COMPILER_ID_CONTENT}# define COMPILER_IS_${Id} 0\n") + set(CMAKE_${lang}_COMPILER_ID_CONTENT "${CMAKE_${lang}_COMPILER_ID_CONTENT}# define ${CID_PREFIX}COMPILER_IS_${Id} 0\n") endforeach() endif() @@ -90,14 +91,16 @@ function(compiler_id_detection outvar lang) endif() set(id_content "${pp_if} ${_compiler_id_pp_test_${Id}}\n") if (CID_ID_STRING) - set(id_content "${id_content}# define COMPILER_ID \"${Id}\"") + set(id_content "${id_content}# define ${CID_PREFIX}COMPILER_ID \"${Id}\"") endif() if (CID_ID_DEFINE) - set(id_content "${id_content}# undef COMPILER_IS_${Id}\n") - set(id_content "${id_content}# define COMPILER_IS_${Id} 1\n") + set(id_content "${id_content}# undef ${CID_PREFIX}COMPILER_IS_${Id}\n") + set(id_content "${id_content}# define ${CID_PREFIX}COMPILER_IS_${Id} 1\n") endif() if (CID_VERSION_STRINGS) - set(id_content "${id_content}${_compiler_id_version_compute_${Id}}\n") + set(PREFIX ${CID_PREFIX}) + string(CONFIGURE "${_compiler_id_version_compute_${Id}}" VERSION_BLOCK @ONLY) + set(id_content "${id_content}${VERSION_BLOCK}\n") endif() set(CMAKE_${lang}_COMPILER_ID_CONTENT "${CMAKE_${lang}_COMPILER_ID_CONTENT}\n${id_content}") set(pp_if "#elif") @@ -109,13 +112,13 @@ function(compiler_id_detection outvar lang) identification macro. Try to identify the platform and guess that it is the native compiler. */ #elif defined(__sgi) -# define COMPILER_ID \"MIPSpro\" +# define ${CID_PREFIX}COMPILER_ID \"MIPSpro\" #elif defined(__hpux) || defined(__hpua) -# define COMPILER_ID \"HP\" +# define ${CID_PREFIX}COMPILER_ID \"HP\" #else /* unknown compiler */ -# define COMPILER_ID \"\"") +# define ${CID_PREFIX}COMPILER_ID \"\"") endif() set(CMAKE_${lang}_COMPILER_ID_CONTENT "${CMAKE_${lang}_COMPILER_ID_CONTENT}\n${platform_compiler_detection}\n#endif") diff --git a/Modules/Compiler/ADSP-DetermineCompiler.cmake b/Modules/Compiler/ADSP-DetermineCompiler.cmake index fc0fd6e..0b5af0d 100644 --- a/Modules/Compiler/ADSP-DetermineCompiler.cmake +++ b/Modules/Compiler/ADSP-DetermineCompiler.cmake @@ -4,7 +4,7 @@ set(_compiler_id_pp_test "defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFI set(_compiler_id_version_compute " #if defined(__VISUALDSPVERSION__) /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ -# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) -# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) +# define @PREFIX@COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) +# define @PREFIX@COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) +# define @PREFIX@COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) #endif") diff --git a/Modules/Compiler/AppleClang-DetermineCompiler.cmake b/Modules/Compiler/AppleClang-DetermineCompiler.cmake index ca05eee..d293b7b 100644 --- a/Modules/Compiler/AppleClang-DetermineCompiler.cmake +++ b/Modules/Compiler/AppleClang-DetermineCompiler.cmake @@ -4,4 +4,4 @@ set(_compiler_id_pp_test "defined(__clang__) && defined(__apple_build_version__) include("${CMAKE_CURRENT_LIST_DIR}/Clang-DetermineCompilerInternal.cmake") set(_compiler_id_version_compute "${_compiler_id_version_compute} -# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)") +# define @PREFIX@COMPILER_VERSION_TWEAK DEC(__apple_build_version__)") diff --git a/Modules/Compiler/Borland-DetermineCompiler.cmake b/Modules/Compiler/Borland-DetermineCompiler.cmake index 8b46830..2e8a948 100644 --- a/Modules/Compiler/Borland-DetermineCompiler.cmake +++ b/Modules/Compiler/Borland-DetermineCompiler.cmake @@ -3,5 +3,5 @@ set(_compiler_id_pp_test "defined(__BORLANDC__)") set(_compiler_id_version_compute " /* __BORLANDC__ = 0xVRR */ -# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) -# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)") +# define @PREFIX@COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define @PREFIX@COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)") diff --git a/Modules/Compiler/Clang-DetermineCompilerInternal.cmake b/Modules/Compiler/Clang-DetermineCompilerInternal.cmake index 615032d..9a37a63 100644 --- a/Modules/Compiler/Clang-DetermineCompilerInternal.cmake +++ b/Modules/Compiler/Clang-DetermineCompilerInternal.cmake @@ -1,11 +1,11 @@ set(_compiler_id_version_compute " -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define @PREFIX@COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define @PREFIX@COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) # if defined(_MSC_VER) -# define SIMULATE_ID \"MSVC\" +# define @PREFIX@SIMULATE_ID \"MSVC\" /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# define @PREFIX@SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define @PREFIX@SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) # endif") diff --git a/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake b/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake index 78f2671..e4def4d 100644 --- a/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake +++ b/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake @@ -3,5 +3,5 @@ set(_compiler_id_pp_test "defined(__COMO__)") set(_compiler_id_version_compute " /* __COMO_VERSION__ = VRR */ -# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100) -# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100)") +# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100) +# define @PREFIX@COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100)") diff --git a/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake b/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake index 2b09102..5855c24 100644 --- a/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake +++ b/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake @@ -3,6 +3,6 @@ set(_compiler_id_pp_test "defined(__DECCXX)") set(_compiler_id_version_compute " /* __DECCXX_VER = VVRRTPPPP */ -# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) -# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) -# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000)") +# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) +# define @PREFIX@COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) +# define @PREFIX@COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000)") diff --git a/Modules/Compiler/Cray-DetermineCompiler.cmake b/Modules/Compiler/Cray-DetermineCompiler.cmake index cf55d2d..6e4eaf9 100644 --- a/Modules/Compiler/Cray-DetermineCompiler.cmake +++ b/Modules/Compiler/Cray-DetermineCompiler.cmake @@ -2,5 +2,5 @@ set(_compiler_id_pp_test "defined(_CRAYC)") set(_compiler_id_version_compute " -# define COMPILER_VERSION_MAJOR DEC(_RELEASE) -# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)") +# define @PREFIX@COMPILER_VERSION_MAJOR DEC(_RELEASE) +# define @PREFIX@COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)") diff --git a/Modules/Compiler/Embarcadero-DetermineCompiler.cmake b/Modules/Compiler/Embarcadero-DetermineCompiler.cmake index 4b85940..f52d79b 100644 --- a/Modules/Compiler/Embarcadero-DetermineCompiler.cmake +++ b/Modules/Compiler/Embarcadero-DetermineCompiler.cmake @@ -2,6 +2,6 @@ set(_compiler_id_pp_test "defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)") set(_compiler_id_version_compute " -# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) -# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) -# define COMPILER_VERSION_PATCH HEX(__CODEGEARC_VERSION__ & 0xFFFF)") +# define @PREFIX@COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) +# define @PREFIX@COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define @PREFIX@COMPILER_VERSION_PATCH HEX(__CODEGEARC_VERSION__ & 0xFFFF)") diff --git a/Modules/Compiler/GNU-DetermineCompiler.cmake b/Modules/Compiler/GNU-DetermineCompiler.cmake index abb19e7..f0c25dd 100644 --- a/Modules/Compiler/GNU-DetermineCompiler.cmake +++ b/Modules/Compiler/GNU-DetermineCompiler.cmake @@ -2,8 +2,8 @@ set(_compiler_id_pp_test "defined(__GNUC__)") set(_compiler_id_version_compute " -# define COMPILER_VERSION_MAJOR DEC(__GNUC__) -# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__GNUC__) +# define @PREFIX@COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) # if defined(__GNUC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# define @PREFIX@COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) # endif") diff --git a/Modules/Compiler/HP-CXX-DetermineCompiler.cmake b/Modules/Compiler/HP-CXX-DetermineCompiler.cmake index 2506e06..6999492 100644 --- a/Modules/Compiler/HP-CXX-DetermineCompiler.cmake +++ b/Modules/Compiler/HP-CXX-DetermineCompiler.cmake @@ -3,6 +3,6 @@ set(_compiler_id_pp_test "defined(__HP_aCC)") set(_compiler_id_version_compute " /* __HP_aCC = VVRRPP */ -# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) -# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100)") +# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) +# define @PREFIX@COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) +# define @PREFIX@COMPILER_VERSION_PATCH DEC(__HP_aCC % 100)") diff --git a/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake b/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake index 9db0663..f673d72 100644 --- a/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake +++ b/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake @@ -1,6 +1,6 @@ set(_compiler_id_version_compute " /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)") +# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define @PREFIX@COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define @PREFIX@COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)") diff --git a/Modules/Compiler/Intel-DetermineCompiler.cmake b/Modules/Compiler/Intel-DetermineCompiler.cmake index 6171ba9..6fada1c 100644 --- a/Modules/Compiler/Intel-DetermineCompiler.cmake +++ b/Modules/Compiler/Intel-DetermineCompiler.cmake @@ -3,20 +3,20 @@ set(_compiler_id_pp_test "defined(__INTEL_COMPILER) || defined(__ICC)") set(_compiler_id_version_compute " /* __INTEL_COMPILER = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) -# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define @PREFIX@COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) # if defined(__INTEL_COMPILER_UPDATE) -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) +# define @PREFIX@COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) # else -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# define @PREFIX@COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) # endif # if defined(__INTEL_COMPILER_BUILD_DATE) /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ -# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# define @PREFIX@COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) # endif # if defined(_MSC_VER) -# define SIMULATE_ID \"MSVC\" +# define @PREFIX@SIMULATE_ID \"MSVC\" /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# define @PREFIX@SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define @PREFIX@SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) # endif") diff --git a/Modules/Compiler/MIPSpro-DetermineCompiler.cmake b/Modules/Compiler/MIPSpro-DetermineCompiler.cmake index 12cf1db..31eb345 100644 --- a/Modules/Compiler/MIPSpro-DetermineCompiler.cmake +++ b/Modules/Compiler/MIPSpro-DetermineCompiler.cmake @@ -4,12 +4,12 @@ set(_compiler_id_pp_test "defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VE set(_compiler_id_version_compute " # if defined(_SGI_COMPILER_VERSION) /* _SGI_COMPILER_VERSION = VRP */ -# define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100) -# define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10) -# define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10) +# define @PREFIX@COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100) +# define @PREFIX@COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10) +# define @PREFIX@COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10) # else /* _COMPILER_VERSION = VRP */ -# define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100) -# define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10) -# define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10) +# define @PREFIX@COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100) +# define @PREFIX@COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10) +# define @PREFIX@COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10) # endif") diff --git a/Modules/Compiler/MSVC-DetermineCompiler.cmake b/Modules/Compiler/MSVC-DetermineCompiler.cmake index 342476a..d462d07 100644 --- a/Modules/Compiler/MSVC-DetermineCompiler.cmake +++ b/Modules/Compiler/MSVC-DetermineCompiler.cmake @@ -3,17 +3,17 @@ set(_compiler_id_pp_test "defined(_MSC_VER)") set(_compiler_id_version_compute " /* _MSC_VER = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) -# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# define @PREFIX@COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define @PREFIX@COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) # if defined(_MSC_FULL_VER) # if _MSC_VER >= 1400 /* _MSC_FULL_VER = VVRRPPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# define @PREFIX@COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) # else /* _MSC_FULL_VER = VVRRPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# define @PREFIX@COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) # endif # endif # if defined(_MSC_BUILD) -# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# define @PREFIX@COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) # endif") diff --git a/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake b/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake index 97dd16c..6d416c1 100644 --- a/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake +++ b/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake @@ -3,8 +3,8 @@ set(_compiler_id_pp_test "defined(__WATCOMC__)") set(_compiler_id_version_compute " /* __WATCOMC__ = VVRP + 1100 */ -# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# define @PREFIX@COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define @PREFIX@COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) # if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# define @PREFIX@COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) # endif") diff --git a/Modules/Compiler/PGI-DetermineCompiler.cmake b/Modules/Compiler/PGI-DetermineCompiler.cmake index 6647f15..8e68bd6 100644 --- a/Modules/Compiler/PGI-DetermineCompiler.cmake +++ b/Modules/Compiler/PGI-DetermineCompiler.cmake @@ -2,8 +2,8 @@ set(_compiler_id_pp_test "defined(__PGI)") set(_compiler_id_version_compute " -# define COMPILER_VERSION_MAJOR DEC(__PGIC__) -# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define @PREFIX@COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) # if defined(__PGIC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# define @PREFIX@COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) # endif") diff --git a/Modules/Compiler/PathScale-DetermineCompiler.cmake b/Modules/Compiler/PathScale-DetermineCompiler.cmake index 40199e6..3335e26 100644 --- a/Modules/Compiler/PathScale-DetermineCompiler.cmake +++ b/Modules/Compiler/PathScale-DetermineCompiler.cmake @@ -2,8 +2,8 @@ set(_compiler_id_pp_test "defined(__PATHCC__)") set(_compiler_id_version_compute " -# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) -# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) +# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__PATHCC__) +# define @PREFIX@COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) # if defined(__PATHCC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) +# define @PREFIX@COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) # endif") diff --git a/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake b/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake index 044f0fa..0a48cc6 100644 --- a/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake +++ b/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake @@ -4,12 +4,12 @@ set(_compiler_id_pp_test "defined(__SUNPRO_CC)") set(_compiler_id_version_compute " # if __SUNPRO_CC >= 0x5100 /* __SUNPRO_CC = 0xVRRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# define @PREFIX@COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) +# define @PREFIX@COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) +# define @PREFIX@COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) # else /* __SUNPRO_CC = 0xVRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# define @PREFIX@COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) +# define @PREFIX@COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) +# define @PREFIX@COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) # endif") diff --git a/Modules/Compiler/TI-DetermineCompiler.cmake b/Modules/Compiler/TI-DetermineCompiler.cmake index d05e5bd..1856c9b 100644 --- a/Modules/Compiler/TI-DetermineCompiler.cmake +++ b/Modules/Compiler/TI-DetermineCompiler.cmake @@ -3,6 +3,6 @@ set(_compiler_id_pp_test "defined(__TI_COMPILER_VERSION__)") set(_compiler_id_version_compute " /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ -# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) -# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) -# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)") +# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define @PREFIX@COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define @PREFIX@COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)") diff --git a/Modules/Compiler/Watcom-DetermineCompiler.cmake b/Modules/Compiler/Watcom-DetermineCompiler.cmake index 2a08277..cc59abf 100644 --- a/Modules/Compiler/Watcom-DetermineCompiler.cmake +++ b/Modules/Compiler/Watcom-DetermineCompiler.cmake @@ -3,8 +3,8 @@ set(_compiler_id_pp_test "defined(__WATCOMC__) && __WATCOMC__ < 1200") set(_compiler_id_version_compute " /* __WATCOMC__ = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# define @PREFIX@COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define @PREFIX@COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) # if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# define @PREFIX@COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) # endif") |