[cmake-developers] How to deal with assembler files

Brad King brad.king at kitware.com
Wed Feb 23 16:27:51 EST 2011


On 02/23/2011 03:36 PM, Alexander Neundorf wrote:
> This is now on stage in the "ReworkedAsmSupport" branch.
> I'd like to merge this into next, if there are no objections.
> It implements what we discussed here, i.e. if there is already a C/CXX 
> compiler it tries to use that too for assembler, if not, it tries to find 
> such a compiler.

Looks good!  BTW, this block:

+if(CMAKE_C_COMPILER_ID STREQUAL "GNU"
+   OR CMAKE_C_COMPILER_ID STREQUAL "HP"
+   OR CMAKE_C_COMPILER_ID STREQUAL "Intel"
+   OR CMAKE_C_COMPILER_ID STREQUAL "SunPro"
+   OR CMAKE_C_COMPILER_ID STREQUAL "XL")
...
+endif(CMAKE_C_COMPILER_ID STREQUAL "GNU"
+   OR CMAKE_C_COMPILER_ID STREQUAL "HP"
+   OR CMAKE_C_COMPILER_ID STREQUAL "Intel"
+   OR CMAKE_C_COMPILER_ID STREQUAL "SunPro"
+   OR CMAKE_C_COMPILER_ID STREQUAL "XL")

is more easily written

if("${CMAKE_C_COMPILER_ID}" MATCHES "^(GNU|HP|Intel|SunPro|XL)$")
...
endif()

-Brad



More information about the cmake-developers mailing list