Merge branch 'release-v4.6.0'
[WPS.git] / metgrid / CMakeLists.txt
blob73a0141b2641bac57f50d14bbaab85337e2b9f84
1 add_executable( metgrid )
3 add_subdirectory( src )
5 set_target_properties( 
6                       metgrid
7                       PROPERTIES
8                         # Just dump everything in here
9                         Fortran_MODULE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/modules/metgrid/
10                         Fortran_FORMAT           FREE
11                       )
14 # Control dependencies and linking
15 target_link_libraries( 
16                       metgrid
17                       PRIVATE
18                         $<$<BOOL:${USE_MPI}>:$<TARGET_NAME_IF_EXISTS:MPI::MPI_Fortran>>
19                         $<$<BOOL:${USE_OPENMP}>:$<TARGET_NAME_IF_EXISTS:OpenMP::OpenMP_Fortran>>
20                         $<$<BOOL:${USE_OPENMP}>:$<TARGET_NAME_IF_EXISTS:OpenMP::OpenMP_C>>
21                         ${netCDF_LIBRARIES}
22                         WRF::io_netcdf
23                         WRF::io_int
24                         WRF::io_grib1
25                         WRF::io_grib_share
26                         WRF::WRF_Core
27                       )
29 target_compile_definitions(
30                             metgrid
31                             PRIVATE
32                               _METGRID
33                             )
35 target_include_directories(
36                             metgrid
37                             PRIVATE
38                               ${netCDF_INCLUDE_DIRS}
39                             )
41 # Add these to the export targets
42 install(
43         TARGETS metgrid
44         EXPORT ${EXPORT_NAME}Targets
45         RUNTIME DESTINATION bin/
46         ARCHIVE DESTINATION lib/
47         LIBRARY DESTINATION lib/
48         )