HomePhabricator
Diffusion MITK 3af2ef7fe35c

Replace - and / with _ in CMake compiler flag variables to avoid warnings.

Description

Replace - and / with _ in CMake compiler flag variables to avoid warnings.

In case of checking -Werror, this leads to false-negatives when checking
if the compiler understands the flag. This is because
CHECK_CXX_COMPILER_FLAG adds the CMake variable as a define to the
compiler arguments and defines containing a - are not valid, triggering
a compiler warning which in case of checking -Werror leads to a
compiler error. Hence the CMake macro thinks the compiler does not
understand the -Werror flag although it actually does.

Clearing the CMAKE_C(XX)_FLAGS_* variables also solves problems on
Windows where the -library=stlport4 flag (inherited from ITK) leads
to warnings (D9002 unknown option) triggering false-negatives.

Details

Provenance
zelzerAuthored on Mar 30 2013, 5:55 PM
Parents
rMITKdfddeb56fd21: Clean up the handling of CMAKE_*_FLAGS variables.
Branches
Unknown
Tags
Unknown