[CMake] Problem with library link order

Tom Kacvinsky tom.kacvinsky at vectorcast.com
Tue Jan 20 12:57:55 EST 2015


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150120/c454e8e1/attachment.html>


More information about the CMake mailing list