[CMake] Override of link flag for one specific shared library

David Cole david.cole at kitware.com
Wed Sep 3 22:23:14 EDT 2008


Maybe save and restore the CMAKE_SHARED_LINKER_FLAGS around your reset of it
in the sub-CMakeLists.txt...?


On Wed, Sep 3, 2008 at 10:41 AM, Martin Apel <martin.apel at simpack.de> wrote:

> Hi,
>
> I have defined the following in a top-level CMakeLists.txt:
>  SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}
> -Wl,--unresolved-symbols=ignore-in-shared-libs")
>
> Now I'd like to reset this for one specific library in a subdirectory
> (in a separate CMakeLists.txt added with ADD_SUBDIRECTORY to the main
> CMakeLists.txt). I tried to use
>  SET_TARGET_PROPERTIES (FortranInterface PROPERTIES LINK_FLAGS
> -Wl,--unresolved-symbols=ignore-in-object-files")
> which reverses the effect of "ignore-in-shared-libs". Unfortunately the
> linker rule contains the LINK_FLAGS before CMAKE_SHARED_LINKER_FLAGS, so
> this cannot be used to override the setting. I have also tried resetting
> CMAKE_SHARED_LINKER_FLAGS in the sub-CMakeLists.txt, but then it applies
> to all other
> libraries handled in this CMakeLists.txt as well.
>
> Any ideas, how I can solve this problem?
>
> Regards,
>
> Martin
>
> ____________
> Virus checked by G DATA AntiVirus
> Version: AVF 19.21 from 03.09.2008
>
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080903/19fd7407/attachment.htm>


More information about the CMake mailing list