[CMake] How to find fortran library

Javier Gonzalez javierggt at yahoo.com
Wed Dec 3 06:55:32 EST 2008


Hi all,

I have a project that links to another project built with Fortran. My
own project is a C++ project and I usually need to link against a
fortran library of some sort to use the first one. I use gcc, so it
usually is libgfortran or libg2c.

Now my question is: if I enable Fortran, will there be a variable that
tells me the location of the library I need to link to?

What I do at the moment is that I guess which library I need to link to
based on the Fortran compiler's name and, since I use gcc, try to find
it in the path given by 'gcc -print-search-dirs'. Is this the right way?
I would expect that cmake defines a variable with this information
somewhere.

thanks,
Javier


More information about the CMake mailing list