Re: [CMake] Accepted way to add -fPIC onto CMAKE_CXX_FLAGS?

2012-06-19 Thread Stephen Kelly
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

[CMake] Accepted way to add -fPIC onto CMAKE_CXX_FLAGS?

2012-06-18 Thread Michael Jackson
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

Re: [CMake] Accepted way to add -fPIC onto CMAKE_CXX_FLAGS?

2012-06-18 Thread Fraser Hutchison
I'm not a Linux guy, so hopefully someone else more knowledgeable can chime in here, but if you want to add to your CMAKE_CXX_FLAGS, you need to avoid creating a semi-colon-separated list by moving the quote mark: set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")

Re: [CMake] Accepted way to add -fPIC onto CMAKE_CXX_FLAGS?

2012-06-18 Thread Alain Leblanc
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

Re: [CMake] Accepted way to add -fPIC onto CMAKE_CXX_FLAGS?

2012-06-18 Thread Mathias Gaunard
On 18/06/2012 23:09, 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

Re: [CMake] Accepted way to add -fPIC onto CMAKE_CXX_FLAGS?

2012-06-18 Thread Michael Jackson
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

Re: [CMake] Accepted way to add -fPIC onto CMAKE_CXX_FLAGS?

2012-06-18 Thread Jean-Christophe Fillion-Robin
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