Merge remote-tracking branch 'origin/release-v4.6.1'
[WRF.git] / external / RSL_LITE / CMakeLists.txt
blob71500f040e33940232d91f7b575356e1699c85e4
1 # WRF CMake Build
3 get_filename_component( FOLDER_COMPILE_TARGET ${CMAKE_CURRENT_SOURCE_DIR} NAME)
5 add_library(
6             ${FOLDER_COMPILE_TARGET}
7               STATIC
8               )
10 target_sources(
11                 ${FOLDER_COMPILE_TARGET}
12                 PRIVATE
13                   c_code.c
14                   buf_for_proc.c
15                   rsl_malloc.c
16                   rsl_bcast.c
17                   task_for_point.c
18                   period.c
19                   swap.c
20                   cycle.c
21                   f_pack.F90
22                   f_xpose.F90
23                   )
25 set_target_properties( 
26                       ${FOLDER_COMPILE_TARGET} 
27                         PROPERTIES
28                           Fortran_MODULE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${FOLDER_COMPILE_TARGET}
29                           EXPORT_PROPERTIES        Fortran_MODULE_DIRECTORY
30                       )
33 target_link_libraries(  ${FOLDER_COMPILE_TARGET}
34                           PRIVATE
35                             $<$<BOOL:${USE_MPI}>:$<TARGET_NAME_IF_EXISTS:MPI::MPI_Fortran>>
36                             $<$<BOOL:${USE_OPENMP}>:$<TARGET_NAME_IF_EXISTS:OpenMP::OpenMP_Fortran>>
37                         )
39 install(
40         TARGETS ${FOLDER_COMPILE_TARGET}
41         EXPORT  ${EXPORT_NAME}Targets
42         RUNTIME DESTINATION bin/
43         ARCHIVE DESTINATION lib/
44         LIBRARY DESTINATION lib/
45         )