You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
643 B

enable_language(C)
enable_language(Fortran)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY out)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY out)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY out)
add_library(FortranTop STATIC mylib.f90)
add_library(CMiddle STATIC mylib.c)
add_library(FortranBottom STATIC mylib.f90)
target_link_libraries(FortranTop PRIVATE CMiddle)
target_link_libraries(CMiddle PRIVATE FortranBottom)
if(OPTIMIZE_TOP)
set_target_properties(FortranTop PROPERTIES
OPTIMIZE_DEPENDENCIES TRUE)
endif()
if(OPTIMIZE_MIDDLE)
set_target_properties(CMiddle PROPERTIES
OPTIMIZE_DEPENDENCIES TRUE)
endif()
include(WriteTargets.cmake)
write_targets()