[CMake] Problem with library link order

J Decker d3ck0r at gmail.com
Tue Jan 20 22:07:54 EST 2015


library link order is exactly as you specify in target_link_libraries...
each line following the last of the prior list.... so reording your library
link list should be doable

On Tue, Jan 20, 2015 at 9:57 AM, Tom Kacvinsky <tom.kacvinsky at vectorcast.com
> wrote:

> HI,
>
> I am using cmake 2.8,11.2 on Linux.  I am having a problem with the order
> of libraries on the link line.  In particular, there are some static
> archives we build that depend on a third party static archive (one we don't
> build - it comes with the Ada compiler we are using), yet the tghird part
> archive is on the link line (as given by the link.txt file) *before* the
> static archives we build.  There are also problems with duplicated shared
> libraries and a few other issues related to linking.  I have not bee able
> to suss out what cmake is doing to construct the list of link libraries
> used, and how it orders them.  It is very important that we have the right
> order of libraries
>
> Unfortunately, our cmake files are too complicated to post here, and also
> depend on a working Ada compiler plus the plplot projects Ada support cmake
> "modules".  Coming up with a simple reproducer is also difficult given the
> latter constaints.
>
> Can anyone point me in the right direction?  If there is a heuristic I can
> follow - like ordering our libraries in target_link_libraries() differently
> - I would like to hear about it.
>
> Thanks,
>
> Tom
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150120/da14b42c/attachment.html>


More information about the CMake mailing list