Use abs paths
[WPS.git] / geogrid / CMakeLists.txt
blob719d94d8c8e0d8e866ca987ff025a6161aae9ed3
1 add_executable( geogrid )
3 add_subdirectory( src )
5 set_target_properties( 
6                       geogrid
7                       PROPERTIES
8                         # Just dump everything in here
9                         Fortran_MODULE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/modules/geogrid/
10                         Fortran_FORMAT           FREE
11                       )
14 # Control dependencies and linking
15 target_link_libraries( 
16                       geogrid
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_int
23                         WRF::io_netcdf
24                         WRF::io_grib1
25                         WRF::io_grib_share
26                         WRF::WRF_Core
27                       )
29 target_compile_definitions(
30                             geogrid
31                             PRIVATE
32                               _GEOGRID
33                             )
35 target_include_directories(
36                             geogrid
37                             PRIVATE
38                               ${netCDF_INCLUDE_DIRS}
39                             )
41 # Add these to the export targets
42 install(
43         TARGETS geogrid
44         EXPORT ${EXPORT_NAME}Targets
45         RUNTIME DESTINATION bin/
46         ARCHIVE DESTINATION lib/
47         LIBRARY DESTINATION lib/
48         )