[CMake] CMake configuration for a Fortran project calling C library

Asmae Houda asmae.houda at gmail.com
Thu Mar 27 13:58:06 EDT 2008


Hello all,

I would like to know how to configure CMakeLists.txt files to do the
following :
1- Let a Fortran90 project placed in the /root/fsrc folder link with a C
shared library placed in /root/contrib/clib folder
2- Specify Fortran as the linker (since Fortran is calling C)

In the /root/CMakeLists.txt I just add subdirectories fsrc and contrib, and
also add clib target in /root/contrib/CMakeLists.txt.

/root/CMakeLists.txt also specify the use of Fortran language.

/root/fsrc/CMakeLists.txt which builds the executable links with the clib
target library.

When issuing the command: > cmake . in the /root folder I get the following
output:
-- The Fortran compiler identification is Intel
-- Check for working Fortran compiler:
/usr/local/intel/fc/10.1.008/bin/ifort
-- Check for working Fortran compiler:
/usr/local/intel/fc/10.1.008/bin/ifort -- works
-- Checking whether /usr/local/intel/fc/10.1.008/bin/ifort supports Fortran
90
-- Checking whether /usr/local/intel/fc/10.1.008/bin/ifort supports Fortran
90 -- yes
-- Configuring done
CMake Error: Cannot determine link language for target "clib".
-- Generating done

So I'm missing something here. How to specify the link language in my
CMakeLists ?

--Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080327/65fa0701/attachment-0003.htm>


More information about the CMake mailing list