[CMake] -pipe, -g and -fPIC on WIN32

Salvatore Iovene salvatore.iovene+cmake at googlemail.com
Wed Nov 7 06:35:52 EST 2007


Hi list,
I'm doing the following:

CHECK_CXX_COMPILER_FLAG("-fPIC" HAVE_FPIC_FLAG)

IF(HAVE_FPIC_FLAG)
  SET(${CMAKE_CXX_FLAGS} "${CMAKE_CXX_FLAGS} -fPIC")
ENDIF(HAVE_FPIC_FLAG)

And the same with -pipe and -g.

This works fine in Linux, but when trying on WIN32 with Visual Studio
command line prompt, I get that the check for the flag succedes, but
then the compiler options are actually -pipe -g -fPIC and the compiler
issues a warning about ignoring those unknown options.

What is the right way of doing this?
Thanks!

-- 
Salvatore Iovene
http://www.iovene.com/
Key Fingerprint: 5647 944D D5AD 2E87 00B4  7D54 2864 359D FF20 16D8


More information about the CMake mailing list