[CMake] How to check for _linker_ flags

Hendrik Sattler post at hendrik-sattler.de
Sat Jul 28 11:52:37 EDT 2007


There seems to be no way to check for linker flags.
I want to check the linker for -Wl,-pie and and -Wl,--no-undefined but 
TRY_COMPILE has no option to define this. Instead, it _always_ issues -fPIC 
when linking.
To make it easy, some of those option require a coordination between compiler 
flags and linker flags.
How can this be done?

I also have a lot of other questions?
Is there a list of the possible _contents_ of magic variables like 

Why is is ${MSVC}, ${BORLAND} and ${WATCOM} but ${CMAKE_COMPILER_IS_GNUCC}? 
Doesn't look like consistent naming to me.

Is there a condition for a 64bit Windows, e.g. WIN64?


More information about the CMake mailing list