[CMake] Checking for compatible compiler flags

Hans Johnson hans.j.johnson at gmail.com
Sun Aug 7 15:33:11 EDT 2011


Hello,

I'm trying to use the cmake feature for testing if compiler flags are valid,
but I am running into trouble with these two complier flags.  I can not
figure out how to proper escape the "+" or the "%" that I believe are
causing the failures.

cat CMakeLists.txt 
============================================
project(TestCompilerFlagTest)

include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)

set(flag -Wno-c++0x-static-nonintegral-init)
check_cxx_compiler_flag(${flag} CXX_HAS_WARNING${flag})
set(flag -features=no%anachronisms )
check_cxx_compiler_flag(${flag} CXX_HAS_WARNING${flag})
============================================

I'd appreciate any help in resolving this.

A more robust version of  /opt/cmake-2.8.4-Darwin-universal/CMake
2.8-4.app/Contents/share/cmake-2.8/Modules/CheckCXXCompilerFlag.cmake
 for use in ITK (and Slicer/SimpleITK/BRAINS) would also be acceptable.

Thanks in advance.

Hans



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110807/6e7c64d5/attachment.htm>


More information about the CMake mailing list