<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
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:<br>
<br>
<code>set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")</code><br>
<br>
Also, "LINUX" is not defined by default using CMake, so unless
you're detecting Linux and setting "LINUX" to true somewhere before
this, the if block will be skipped. UNIX is defined by default, but
this includes OSX, so if you really want just Linux, use something
like<br>
<br>
<code>if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")</code><br>
<br>
Finally, I guess "CMAKE_CSS_FLAGS" is a typo?<br>
<br>
Cheers,<br>
Fraser.<br>
<br>
<br>
<div class="moz-cite-prefix">On 18/06/2012 22:09, Michael Jackson
wrote:<br>
</div>
<blockquote
cite="mid:4D3914F6-5DE0-4A31-8C81-1BE30C083588@bluequartz.net"
type="cite">
<pre wrap="">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
<a class="moz-txt-link-abbreviated" href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a> <a class="moz-txt-link-abbreviated" href="http://www.bluequartz.net">www.bluequartz.net</a>
--
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>
Visit other Kitware open-source projects at <a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>
Please keep messages on-topic and check the CMake FAQ at: <a class="moz-txt-link-freetext" href="http://www.cmake.org/Wiki/CMake_FAQ">http://www.cmake.org/Wiki/CMake_FAQ</a>
Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a>
</pre>
</blockquote>
<br>
<br>
</body>
</html>