| 1 |
include_directories(${Library_MODDIR}) |
| 2 |
add_library(subdir_mods a.f90 b.f90) |
| 3 |
add_executable(subdir_exe main.f90) |
| 4 |
target_link_libraries(subdir_exe subdir_mods) |
| 5 |
|
| 6 |
add_library(cycleA STATIC cycleA1.f90 cycleA2.f90) |
| 7 |
add_library(cycleB STATIC cycleB1.f90 cycleB2.f90) |
| 8 |
target_link_libraries(cycleA PRIVATE cycleB) |
| 9 |
target_link_libraries(cycleB PRIVATE cycleA) |
| 10 |
|
| 11 |
# Test module output directory if available. |
| 12 |
if(CMAKE_Fortran_MODDIR_FLAG) |
| 13 |
set_target_properties(subdir_mods cycleA cycleB PROPERTIES |
| 14 |
Fortran_MODULE_DIRECTORY modules |
| 15 |
) |
| 16 |
endif() |