-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
54 lines (43 loc) · 1.55 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
CMAKE_MINIMUM_REQUIRED(VERSION 3.2)
PROJECT(ode_solver)
SET(CMAKE_CXX_STANDARD 17)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
SET(NetCDF_Fortran_LIBRARIES CACHE PATH "")
SET(NetCDF_Fortran_INCLUDE_DIR CACHE PATH "")
ENABLE_LANGUAGE(Fortran)
if(NetCDF_Fortran_LIBRARIES STREQUAL "")
FIND_PACKAGE(NetCDF REQUIRED COMPONENTS Fortran)
endif()
INCLUDE_DIRECTORIES(${NetCDF_Fortran_INCLUDE_DIR})
SET(OUTPUT_DIR CACHE PATH "")
IF (OUTPUT_DIR STREQUAL "")
SET(OUTPUT_DIR ${CMAKE_SOURCE_DIR}/output)
ENDIF ()
IF (NOT EXISTS ${OUTPUT_DIR})
FILE(MAKE_DIRECTORY ${OUTPUT_DIR})
ENDIF ()
ADD_LIBRARY(ode_solver
${CMAKE_SOURCE_DIR}/src/equations.f90
${CMAKE_SOURCE_DIR}/src/integrator.f90
${CMAKE_SOURCE_DIR}/src/euler_integrator.f90
${CMAKE_SOURCE_DIR}/src/rk_integrator.f90
${CMAKE_SOURCE_DIR}/src/observer.f90
${CMAKE_SOURCE_DIR}/src/system.f90
${CMAKE_SOURCE_DIR}/src/lorenz_system.f90
${CMAKE_SOURCE_DIR}/src/solver.f90
${CMAKE_SOURCE_DIR}/src/settings.f90
${CMAKE_SOURCE_DIR}/src/shallow_water_system.f90
${CMAKE_SOURCE_DIR}/src/netcdf_utils.f90
)
TARGET_LINK_LIBRARIES(ode_solver ${NetCDF_Fortran_LIBRARIES})
SET_TARGET_PROPERTIES(
ode_solver
PROPERTIES
LINKER_LANGUAGE Fortran
)
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)
ADD_EXECUTABLE(
solver
${CMAKE_SOURCE_DIR}/src/mains/ode_solver.f90
)
TARGET_LINK_LIBRARIES(solver ode_solver)