« first day (1 day earlier)    last day (15 days later) » 

1:18 PM
project (test Fortran)
add_library (lib1 dir1/lib1.f90)
add_library (lib2 dir2/lib2.f90 dir2/mod.f90)
target_link_libraries (lib1 lib2)
add_executable (exe dir3/exe.f90)
target_link_libraries (exe lib1 lib2)
or
project (test Fortran)
add_library (lib2 dir2/lib2.f90 dir2/mod.f90)
add_library (lib1 dir1/lib1.f90)
add_executable (exe dir3/exe.f90)
target_link_libraries (exe lib1 lib2)
both work
project (test Fortran)
add_library (lib2 dir2/lib2.f90 dir2/mod.f90)
add_library (lib1 dir1/lib1.f90)
target_link_libraries (lib1 lib2)
add_executable (exe dir3/exe.f90)
target_link_libraries (exe lib1 lib2)
the later one is what I would use
no version handles the deletion of foo.mod properly
First class object, for cmake as I guess for most other build systems, are object files. This ends up being fragile when deleting .mod files
Do you actually need to remove .mod files in your work?
Else the third CMakeLists.txt above should do
 
I don't need to remove .mod files, but I need to recompile the right things if the .mod files change. Manually specifying that lib1 depends on lib2 is not an option.
 

« first day (1 day earlier)    last day (15 days later) »