Page MenuHomePhabricator

Properly handle CMake compiler and linker flags in MITK
Closed, ResolvedPublic

Event Timeline

[0ef0c1]: Merge branch 'bug-14783-cmake-compiler-and-linker-flags'

Merged commits:

2013-03-19 09:31:49 Sascha Zelzer [dfddeb]
Clean up the handling of CMAKE_*_FLAGS variables.

Also removed the ADDITIONAL_*_FLAGS variables from the MITK build and
added a MITK prefix to them in the super-build.


2013-03-19 09:30:09 Sascha Zelzer [fbd86a]
Don't remove - and = characters, since it would lead to ambiguous flags.

For example, -ftemplate-depth=50 and -ftemplate-depth-50 would get
the same cache entry, leading to problems when checking for both.

New remote branch pushed: bug-14783-cmake-compiler-and-linker-flags

[46a6fa]: Merge branch 'bug-14783-cmake-compiler-and-linker-flags'

Merged commits:

2013-03-30 17:55:21 Sascha Zelzer [3af2ef]
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.