Sync netCDF modules with WRF
[WPS.git] / ungrib / CMakeLists.txt
blobe6711e2015269c3fe8defefc372dd28c275d2437
1 add_executable( ungrib )
2 add_executable( g1print )
3 add_executable( g2print )
4 add_library   ( pgu )
6 add_subdirectory( src )
8 set_target_properties( 
9                       pgu
10                       PROPERTIES
11                         # Just dump everything in here
12                         Fortran_MODULE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/ungrib/
13                         Fortran_FORMAT           FREE
14                       )
16 set_target_properties( 
17                       ungrib
18                       PROPERTIES
19                         # Just dump everything in here
20                         Fortran_MODULE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/ungrib/
21                         Fortran_FORMAT           FREE
22                       )
24 set_target_properties( 
25                       g1print
26                       PROPERTIES
27                         # Just dump everything in here
28                         Fortran_MODULE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/ungrib/
29                         Fortran_FORMAT           FREE
30                       )
32 set_target_properties( 
33                       g2print
34                       PROPERTIES
35                         # Just dump everything in here
36                         Fortran_MODULE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/ungrib/
37                         Fortran_FORMAT           FREE
38                       )
40 # Control dependencies and linking
41 target_link_libraries( 
42                       ungrib
43                       PRIVATE
44                         w3
45                         g2
46                         pgu
47                         Jasper::Jasper
48                         PNG::PNG
49                         ZLIB::ZLIB
50                       )
52 target_link_libraries(
53                       g1print
54                       PRIVATE
55                         pgu
56                       )
58 target_link_libraries(
59                       g2print
60                       PRIVATE
61                         w3
62                         g2
63                         Jasper::Jasper
64                         PNG::PNG
65                         ZLIB::ZLIB
66                         pgu
67                       )
70 target_include_directories(
71                             ungrib
72                             PRIVATE
73                               $<TARGET_PROPERTY:g2,Fortran_MODULE_DIRECTORY>
74                               $<TARGET_PROPERTY:w3,Fortran_MODULE_DIRECTORY>
75                             )
78 target_include_directories(
79                             g2print
80                             PRIVATE
81                               $<TARGET_PROPERTY:g2,Fortran_MODULE_DIRECTORY>
82                               $<TARGET_PROPERTY:w3,Fortran_MODULE_DIRECTORY>
83                             )
84 # $<$<BOOL:${USE_MPI}>:$<TARGET_NAME_IF_EXISTS:MPI::MPI_Fortran>>
85 # $<$<BOOL:${USE_OPENMP}>:$<TARGET_NAME_IF_EXISTS:OpenMP::OpenMP_Fortran>>
86 # ${netCDF_INCLUDE_DIRS}
89 # Add these to the export targets
90 install(
91         TARGETS ungrib g1print g2print pgu
92         EXPORT ${EXPORT_NAME}Targets
93         RUNTIME DESTINATION bin/
94         ARCHIVE DESTINATION lib/
95         LIBRARY DESTINATION lib/
96         )