3 get_filename_component( FOLDER_COMPILE_TARGET ${CMAKE_CURRENT_SOURCE_DIR} NAME)
6 ${FOLDER_COMPILE_TARGET}
10 # Do this first to simplify steps later
11 set_target_properties(
12 ${FOLDER_COMPILE_TARGET}
14 Fortran_MODULE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${FOLDER_COMPILE_TARGET}
15 EXPORT_PROPERTIES Fortran_MODULE_DIRECTORY
19 target_link_libraries( ${FOLDER_COMPILE_TARGET}
21 $<$<BOOL:${USE_MPI}>:$<TARGET_NAME_IF_EXISTS:MPI::MPI_Fortran>>
22 $<$<BOOL:${USE_OPENMP}>:$<TARGET_NAME_IF_EXISTS:OpenMP::OpenMP_Fortran>>
25 target_include_directories( ${FOLDER_COMPILE_TARGET}
27 ${CMAKE_CURRENT_SOURCE_DIR}/../ioapi_share
28 ${CMAKE_INSTALL_PREFIX}/${FOLDER_COMPILE_TARGET}
33 get_target_property ( FOLDER_COMPILE_TARGET_INCLUDES ${FOLDER_COMPILE_TARGET} INCLUDE_DIRECTORIES )
34 wrf_c_preproc_fortran(
35 TARGET_NAME ${FOLDER_COMPILE_TARGET}_c_preproc_wrf_io
36 OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/preproc/
38 INCLUDES ${FOLDER_COMPILE_TARGET_INCLUDES}
39 DEFINITIONS ${PROJECT_COMPILE_DEFINITIONS}
44 wrf_m4_preproc_fortran(
45 TARGET_NAME ${FOLDER_COMPILE_TARGET}_m4_preproc_wrf_io
46 OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/preproc/
49 SOURCES ${CMAKE_CURRENT_BINARY_DIR}/preproc/wrf_io.f90
50 DEPENDENCIES ${FOLDER_COMPILE_TARGET}_c_preproc_wrf_io
51 TARGET_SCOPE ${FOLDER_COMPILE_TARGET}
55 add_dependencies( ${FOLDER_COMPILE_TARGET} ${FOLDER_COMPILE_TARGET}_m4_preproc_wrf_io )
58 ${FOLDER_COMPILE_TARGET}
60 ${CMAKE_CURRENT_BINARY_DIR}/preproc/m4_preproc_wrf_io.f90
65 TARGETS ${FOLDER_COMPILE_TARGET}
66 EXPORT ${EXPORT_NAME}Targets
67 RUNTIME DESTINATION bin/
68 ARCHIVE DESTINATION lib/
69 LIBRARY DESTINATION lib/