forked from ESCOMP/CDEPS
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathCMakeLists.txt
39 lines (31 loc) · 1.19 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
set(SRCFILES dshr_methods_mod.F90
dshr_strdata_mod.F90
dshr_stream_mod.F90
dshr_tinterp_mod.F90)
set(MODFILES ${SRCFILES})
foreach(FILE ${SRCFILES})
list(TRANSFORM MODFILES REPLACE ".F90" ".mod")
if(EXISTS "${CASEROOT}/SourceMods/src.cdeps/${FILE}")
list(REMOVE_ITEM SRCFILES ${FILE})
list(APPEND SRCFILES "${CASEROOT}/SourceMods/src.cdeps/${FILE}")
message("Using ${FILE} from ${CASEROOT}/SourceMods/src.cdeps")
endif()
endforeach()
message("Stream srcfiles are ${SRCFILES}")
add_library(streams ${SRCFILES})
if(NOT DISABLE_FoX)
add_dependencies(streams FoX_dom)
target_include_directories (streams PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../fox/include)
endif()
if(BLD_STANDALONE)
add_dependencies(streams cdeps_share)
target_include_directories (streams PRIVATE ${CMAKE_BINARY_DIR}/share)
endif()
target_include_directories (streams PRIVATE ${ESMF_F90COMPILEPATHS})
target_include_directories (streams PRIVATE ${PIO_Fortran_INCLUDE_DIR})
install(TARGETS streams
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
foreach(MOD ${MODFILES})
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${MOD}" DESTINATION include)
endforeach()