Michael Jackson wrote: > Linux really wants to have -fPIC for some of my code and I am trying to > detect linux and then add this flag for my project but I am having no > luck. > > if (LINUX) > set(CMAKE_CXX_FLAGS ${CMAKE_CSS_FLAGS} "-fPIC") > endif() > > Is this NOT the way I should be doing this? It doesn't really "fell" > correct but nothing else (including this) seems to work. > > Help?
In (upcoming) CMake 2.8.9 you can set the POSITION_INDEPENDENT_CODE property on a target, or you can set the global variable set(CMAKE_POSITION_INDEPENDENT_CODE ON) to make all following targets position independent. Thanks, Steve. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake