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}
23 $<$<BOOL:${USE_MPI}>:$<TARGET_NAME_IF_EXISTS:MPI::MPI_Fortran>>
24 $<$<BOOL:${USE_OPENMP}>:$<TARGET_NAME_IF_EXISTS:OpenMP::OpenMP_Fortran>>
27 target_include_directories( ${FOLDER_COMPILE_TARGET}
29 ${netCDF_INCLUDE_DIRS}
30 ${pnetCDF_INCLUDE_DIRS}
31 ${CMAKE_CURRENT_SOURCE_DIR}
32 ${CMAKE_CURRENT_SOURCE_DIR}/../ioapi_share
33 ${CMAKE_INSTALL_PREFIX}/${FOLDER_COMPILE_TARGET}
38 get_target_property ( FOLDER_COMPILE_TARGET_INCLUDES ${FOLDER_COMPILE_TARGET} INCLUDE_DIRECTORIES )
39 wrf_c_preproc_fortran(
40 TARGET_NAME ${FOLDER_COMPILE_TARGET}_c_preproc_wrf_io
41 OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/preproc/
43 INCLUDES ${FOLDER_COMPILE_TARGET_INCLUDES}
44 DEFINITIONS ${PROJECT_COMPILE_DEFINITIONS}
49 wrf_m4_preproc_fortran(
50 TARGET_NAME ${FOLDER_COMPILE_TARGET}_m4_preproc_wrf_io
51 OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/preproc/
54 SOURCES ${CMAKE_CURRENT_BINARY_DIR}/preproc/wrf_io.f90
55 DEPENDENCIES ${FOLDER_COMPILE_TARGET}_c_preproc_wrf_io
56 TARGET_SCOPE ${FOLDER_COMPILE_TARGET}
60 add_dependencies( ${FOLDER_COMPILE_TARGET} ${FOLDER_COMPILE_TARGET}_m4_preproc_wrf_io )
63 ${FOLDER_COMPILE_TARGET}
65 ${CMAKE_CURRENT_BINARY_DIR}/preproc/m4_preproc_wrf_io.f90
66 module_wrfsi_static.F90
71 TARGETS ${FOLDER_COMPILE_TARGET}
72 EXPORT ${EXPORT_NAME}Targets
73 RUNTIME DESTINATION bin/
74 ARCHIVE DESTINATION lib/
75 LIBRARY DESTINATION lib/