[CMake] making executible in mixed C/fortran project

luxInteg lux-integ at btconnect.com
Fri Nov 12 08:46:00 EST 2010


Greetings,

I am learning cmake

I am building an executable  which needs to   first compile a C program  and 
then recompiling the object file   with another file in fortran.


Here is  an excerpt from a unix makefile I am attempt to port to cmake as part 
of my cmake turotial.

fileC.o: fileC.c
	$(C) -DDINT -c fileC.c

fileD:  fileD.f fileC.o ../lib/libF.a
	$(F77) $(F77FLAGS) -o fileD fileD.f fileC.o    ../lib/libF.a $(F77LIB)



I  think I have learnt enough cmake to do most of the above  EXCEPT I am 
unsure how on compile an object file  (in this case  fileC.o
with a fortran compiler (if I have translated the makefile correctly)
 Does one  rename   the file or whatever?
Guidance on how to do this would be appreciated


More information about the CMake mailing list