[CMake] Incorrect implicit library selections in generated link statements

Schuchard, Matthew Matthew.Schuchard at gtri.gatech.edu
Tue Jan 3 14:30:21 EST 2012


I have a large static library comprised of C, C++, Fortran, and Ada source files.
I have a number of C, C++, Fortran, and Ada executables linking against this library.

When CMake generates the link statements in link.txt, the implicit libraries selected to be linked against from the possibilities located in CMakeFiles/CMake[lang]Compiler.cmake are always incorrect.

For example, in an Ada executable, the implicit libraries selected to be linked against are only C and Fortran, not Ada, and some of the libraries selected are superfluous while other necessary libraries are not included at all.  Also, the directory where the Fortran libraries are found is not pulled from the implicit link directory possibilities, whereas the C one is.

For a Fortran executable, the libraries selected to be linked against are found from C, Fortran, C++, and Ada, but once again the library selection seems random and the directory containing the Ada libraries is absent from the link statement.  This is especially disconcerting since those libraries are in /usr/lib[64].

Why is CMake's link statement logic regarding implicit libraries completely imploding when executables link against a static library comprised of multiple languages?
Does anyone know of some good hacks/kludges to circumvent CMake's behavior?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120103/702f7588/attachment-0001.htm>


More information about the CMake mailing list