[CMake] Compile a fortran exe from several subdirs

PULVERAIL, Sebastien sebastien.pulverail at sogeti.com
Tue Oct 14 14:29:06 EDT 2014


Hi everyone,

I'm using cmake to generate my executable. And I am facing some issues.
Let's assume I have the following tree :

Src/
    01_Module1/
        File1.F90
        File2.F90
   02_Module2/
        File3.F90
        File4.F90
        File5.F90
    03_Module3/
        File6.F90
        File7.F90
Bin/
Obj/

I need to generate "exe1" in "Bin" directory from all the Fortran source files in "Src" directory.
Moreover:

è "01_Module1" has to be compile before "02_Module2" and "02_Module2" has to be compiled before "03_Module3".

è All the F90 source files in the "Src" directory have to be compiled and linked to generate "exe1".

è All the object files have to be generated in "Obj" directory.

I have strictly no idea how I have to make my CMakeLists.txt files, and I really need your help on this.
Can you help me doing this please?

Thanks in advance for your help!

Sébastien.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20141014/710c43ef/attachment.html>


More information about the CMake mailing list