Hi Michael, To apply the flag on a specific target, consider looking at: https://github.com/commontk/Log4Qt/blob/patched/CMakeLists.txt#L116
Hth Jc On Mon, Jun 18, 2012 at 8:23 PM, Michael Jackson < mike.jack...@bluequartz.net> wrote: > Thanks everyone for the help. I really have a typo in my CMake code so > thanks for every one for finding that. Basically we build a few libraries > which other parts of our code depend on. One particular library has to be a > shared library but links statically to the other libraries in order to > avoid some STL issues that are on VS 2008 and 2010. I bet these issues are > not around on GCC with Linux so I bet I need to basically put in a > safeguard to only build shared libraries on Linux and no-where else but I > need to test that theory. > I like the source files properties idea but I would need to apply that to > just about every source file in our project. For now an all encompassing > -fPIC for everything should solve the issue for the moment until a better > fix in the form of a rewritten API can be put in. > > Thanks everyone for helping > ___________________________________________________________ > Mike Jackson Principal Software Engineer > BlueQuartz Software Dayton, Ohio > mike.jack...@bluequartz.net www.bluequartz.net > > On Jun 18, 2012, at 8:09 PM, Alain Leblanc wrote: > > > > > Starting to dislike the gmail program. > > > > So here's a corrected message , to the list this time: > > > > ======================================= > > > > This is how I've been doing for years. Doesn't mean it's the right way :) > > > > Here -O3 and -DLINUX don't apply to your case, and ${SRC_FILES} has been > assigned with the file() command. Using ${UNIX}, but ${LINUX} would work as > well, maybe. > > > > if (${UNIX}) > > set (EXTRA_OPTIONS "-O3 -Wno-deprecated -fPIC -DLINUX") > > endif (${UNIX}) > > . > > . > > . > > set_source_files_properties(${SRC_FILES} > > PROPERTIES > > COMPILE_FLAGS "${EXTRA_OPTIONS}") > > > > > > > > On 06/18/2012 05:09 PM, 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? > >> > >> Thanks > >> ___________________________________________________________ > >> Mike Jackson Principal Software Engineer > >> BlueQuartz Software Dayton, Ohio > >> mike.jack...@bluequartz.net www.bluequartz.net > >> > >> -- > >> > >> 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 > > > > -- > > > > 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 > > -- > > 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 > -- +1 919 869 8849
-- 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