1 # This macro gets the version string for a compiler, and also extracts
5 # LANGUAGE - C or CXX, the compiler to check for
6 # BUILD_COMPILER - [output variable] string with compiler path, ID and
7 # some compiler-provided information
8 # BUILD_FLAGS - [output variable] flags for the compiler
10 macro(get_compiler_info LANGUAGE BUILD_COMPILER BUILD_FLAGS)
11 set(${BUILD_COMPILER} "${CMAKE_${LANGUAGE}_COMPILER} ${CMAKE_${LANGUAGE}_COMPILER_ID} ${CMAKE_${LANGUAGE}_COMPILER_VERSION}")
12 string(TOUPPER ${CMAKE_BUILD_TYPE} _build_type)
13 set(${BUILD_FLAGS} "${CMAKE_${LANGUAGE}_FLAGS} ${CMAKE_${LANGUAGE}_FLAGS_${_build_type}}")