Merge remote-tracking branch 'origin/release-v4.6.1'
[WRF.git] / external / io_grib1 / CMakeLists.txt
blob3c6a057d8345c08b77988fc932e3ab38539240ea
1 # WRF CMake Build
3 add_subdirectory( MEL_grib1  )
4 add_subdirectory( grib1_util )
5 add_subdirectory( WGRIB      )
7 get_filename_component( FOLDER_COMPILE_TARGET ${CMAKE_CURRENT_SOURCE_DIR} NAME )
9 add_library(
10             ${FOLDER_COMPILE_TARGET}
11               STATIC
12               )
14 target_sources(
15                 ${FOLDER_COMPILE_TARGET}
16                 PRIVATE
17                   grib1_routines.c
18                   gribmap.c
19                   io_grib1.F
20                   trim.c
21                   )
23 set_target_properties( 
24                       ${FOLDER_COMPILE_TARGET} 
25                         PROPERTIES
26                           Fortran_MODULE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${FOLDER_COMPILE_TARGET}
27                           Fortran_FORMAT           FREE
28                           EXPORT_PROPERTIES        Fortran_MODULE_DIRECTORY
29                       )
32 target_include_directories( ${FOLDER_COMPILE_TARGET}
33                             PRIVATE
34                               ${CMAKE_CURRENT_SOURCE_DIR}/../ioapi_share 
35                               ${CMAKE_CURRENT_SOURCE_DIR}/../io_grib_share
36                               ${CMAKE_CURRENT_SOURCE_DIR}/grib1_util
37                               ${CMAKE_CURRENT_SOURCE_DIR}/MEL_grib1
38                             )
40 install(
41         TARGETS ${FOLDER_COMPILE_TARGET}
42         EXPORT  ${EXPORT_NAME}Targets
43         RUNTIME DESTINATION bin/
44         ARCHIVE DESTINATION lib/
45         LIBRARY DESTINATION lib/
46         )