[CMake] static library link order

Biddiscombe, John A. biddisco at cscs.ch
Thu Mar 4 09:56:18 EST 2010


given a config like this

TARGET_LINK_LIBRARIES(${KIT}CxxTests vtkIO vtkImaging vtksys)

I have the trouble that vtksys pulls in a whole bunch of DynamicLoader stuff (kwsys) - which apart from being rather odd when building statically, forces the linker to need -ldl added to the link line.

The trouble I've got is that no matter which EXE_LINKER_FLAG etc, or other option I change, TARGET_LINK_LIBRARIES adds stuff to the end, and on linux, link order is important, so I am constantly having to manually edit cmake/make files to get stuff to link (libdl, libGL, libmpich, lib etc etc). This problem is a big one in the whole paraview build system.

Is there any simple fix out there? (NB. It's not just libdl, but many others like it).

JB


--
John Biddiscombe,                            email:biddisco @ cscs.ch
http://www.cscs.ch/
CSCS, Swiss National Supercomputing Centre  | Tel:  +41 (91) 610.82.07
Via Cantonale, 6928 Manno, Switzerland      | Fax:  +41 (91) 610.82.82

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100304/7a53706c/attachment-0001.htm>


More information about the CMake mailing list