<div dir="ltr">Are you using SUBDIRS or ADD_SUBDIRECTORY in your project...?<br><br><div><br><div class="gmail_quote">On Thu, Sep 4, 2008 at 2:42 AM, Martin Apel <span dir="ltr"><<a href="mailto:martin.apel@simpack.de">martin.apel@simpack.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Unfortunately this does not work. It seems that CMake generates all<br>
libraries defined in one CMakeLists.txt with the setting of<br>
CMAKE_SHARED_LINKER_FLAGS at the end of the file.<br>
This causes this setting to be applied to all libraries in the<br>
CMakeLists.txt. As I have 4 libraries in this one CMakeLists.txt, this<br>
doesn't help much.<br>
<br>
I tried to do something like the following:<br>
SET (CMAKE_SHARED_LINKER_FLAGS "${ORIG_SHARED_LINKER_FLAGS}")<br>
ADD_LIBRARY (FortranInterface ${OBJS})<br>
SET (CMAKE_SHARED_LINKER_FLAGS "${MODIFIED_SHARED_LINKER_FLAGS}")<br>
but the FortranInterface library gets built with<br>
MODIFIED_SHARED_LINKER_FLAGS in effect.<br>
<br>
I would suggest to change the order of items in the build rules for a<br>
future CMake release, such that it's possible to override general flags<br>
with a target specific property. Today the link<br>
rules look as follows:<br>
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY "<CMAKE_CXX_COMPILER> ...<br>
<LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> ....")<br>