[CMake] FW: building a mixed language programm with CMake

Natalie Happenhofer nataliehapp at hotmail.com
Tue Jun 9 09:31:04 EDT 2009










Hi everybody,
I´d like to build a mixed language programm with CMake, more specifically, I have a C++ and a Fortran90 source file I want to link:
tp500main.cxx and electro1.f90

I´m just wondering how it is done with CMake. The point is, I need to compile the sources separately with the corresponding compiler and then link it together. 
I tried the following:

cmake_minimum_required(VERSION 2.6)
project(tp500)

enable_language(Fortran)

try_compile(electro1.f90)
try_compile(tp500main.cpp)

target_link_libraries(tp500 electro1.o tp500main.o)


which is, I suppose, a rather crude approach, but I hope it shows what I´m trying to do.. 

thanks a lot for any piece of advice,
Natalie Happenhofer




_________________________________________________________________
Disfruta los mejores videos de MSN mientras chateas
http://messengertv.msn.com/mkt/es-xl/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090609/2e629995/attachment.htm>


More information about the CMake mailing list