[CMake] Append Implicit Link Library

Schuchard, Matthew Matthew.Schuchard at gtri.gatech.edu
Wed Dec 14 08:23:30 EST 2011


I am trying to add a library to implicitly link against for the Absoft Fortran compiler.  CMake generates the libraries to implicitly link against for this compiler seemingly from source code, since the Compiler/Absoft-Fortran and Platforum/Linux-Absoft contain nothing about what libraries to implicitly link against.  The cmake.in file that the CMake Fortran module uses to configure the compiler also contains @ references for its values.  I am also forcing CMake to recognize the compiler as Absoft since, via normal detection processes, Absoft will identify itself as GNUFortran.

I need to add the U77 library to implicitly link against.  Doing the following in the top level CMakeList does not work:

set(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES} U77 CACHE STRING "stuff" FORCE)

and it even shows up in my cache as only U77.  However, when I set it for Ada in my top level CMakeList, the output compiler information file does correctly recognize the libraries to implicitly link against.  This may be, however, because all the Ada modules for our build configuration were created by me since CMake does not come with any.

I could institute a 'sed' command to change the implicit link libraries in the CMakeFiles/CMakeFortranCompilerInformation file, but I feel that is not only inelegant but probably opening a can of worms in case a 'make' command causes a reconfiguration at a lower level of the build tree.

Is there any method in CMake to add another library for a CMake recognized compiler to implicitly link against?  If not, does anyone know of a good hack that will not have unforeseen consequences?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111214/e44cd705/attachment.htm>


More information about the CMake mailing list