Update version info for release v4.6.1 (#2122)
[WRF.git] / external / esmf_time_f90 / CMakeLists.txt
blob9e3f610878563e2b39c8b3d187b2cb00e1360abb
1 # WRF CMake Build
2 get_filename_component( FOLDER_COMPILE_TARGET ${CMAKE_CURRENT_SOURCE_DIR} NAME)
4 add_library(
5             ${FOLDER_COMPILE_TARGET}
6               STATIC
7               )
8 # Test1_ESMF
9 # Test1_WRFU
10 target_sources(
11                 ${FOLDER_COMPILE_TARGET}
12                 PRIVATE
13                   ESMF_Alarm.F90
14                   ESMF_BaseTime.F90
15                   ESMF_Clock.F90
16                   ESMF_Time.F90
17                   Meat.F90
18                   ESMF_Base.F90
19                   ESMF_Calendar.F90
20                   ESMF_Fraction.F90
21                   ESMF_TimeInterval.F90
22                   ESMF_Stubs.F90
23                   ESMF_Mod.F90
24                   module_symbols_util.F90
25                   module_utility.F90
26                   ESMF_AlarmClock.F90
27                   )
29 # target_compile_options(
30 #                         ${FOLDER_COMPILE_TARGET}
31 #                         PRIVATE
32 #                           # Specific flags for this target
33 #                       )
35 set_target_properties( 
36                       ${FOLDER_COMPILE_TARGET} 
37                         PROPERTIES
38                           Fortran_MODULE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${FOLDER_COMPILE_TARGET}
39                           EXPORT_PROPERTIES        Fortran_MODULE_DIRECTORY
40                       )
43 target_link_libraries(  ${FOLDER_COMPILE_TARGET}
44                           PRIVATE
45                             $<$<BOOL:${USE_MPI}>:$<TARGET_NAME_IF_EXISTS:MPI::MPI_Fortran>>
46                             $<$<BOOL:${USE_OPENMP}>:$<TARGET_NAME_IF_EXISTS:OpenMP::OpenMP_Fortran>>
47                           )
49 target_include_directories( ${FOLDER_COMPILE_TARGET}
50                             PRIVATE
51                               ${CMAKE_CURRENT_SOURCE_DIR}
52                             )
54 install(
55         TARGETS ${FOLDER_COMPILE_TARGET}
56         EXPORT  ${EXPORT_NAME}Targets
57         RUNTIME DESTINATION bin/
58         ARCHIVE DESTINATION lib/
59         LIBRARY DESTINATION lib/
60         )