-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
81 lines (67 loc) · 2.39 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
cmake_minimum_required(VERSION 3.0)
project(trifourtopo LANGUAGES Fortran)
set(CMAKE_Fortran_COMPILER gfortran-11)
set(OROG_SOURCE four_topo)
set(LINKER linker)
find_package(BLAS REQUIRED)
find_package(LAPACK REQUIRED)
find_package(fortran_stdlib REQUIRED)
find_package(OpenMP REQUIRED)
find_path (NETCDFF_INCLUDES_F90 netcdf.mod HINTS NETCDFF_DIR NETCDFF_DIR)
message(" inc ff = ${NETCDFF_INCLUDES_F90} ")
find_library (NETCDFF_LIBRARIES_F90 NAMES netcdff HINTS NETCDFF_DIR )
message(" lib ff = ${NETCDFF_LIBRARIES_F90} ")
mark_as_advanced(NETCDF_LIBRARIES_F90)
set(CMAKE_Fortran_MODULE_DIRECTORY
${CMAKE_BINARY_DIR}/modules)
set(CMAKE_VERBOSE_MAKEFILE ON)
file(MAKE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
add_compile_options(-fopenmp -g -Wall -Wextra -fdefault-real-8)
link_libraries("-fopenmp")
add_executable(${OROG_SOURCE}
src/orog_source.f90
src/io/read_data_mod.f90
src/io/write_data_mod.f90
src/io/netcdf_check_mod.f90
src/tools/const_mod.f90
src/tools/error_status_mod.f90
src/tools/utils_mod.f90
src/tools/triangle_mod.f90
src/var/topo_mod.f90
src/math/fourier_mod.f90
src/math/lin_reg_mod.f90
)
target_include_directories(${OROG_SOURCE}
PUBLIC
"/usr/include"
${NETCDFF_INCLUDES_F90}
)
target_link_libraries(${OROG_SOURCE}
PRIVATE
${NETCDFF_LIBRARIES_F90}
fortran_stdlib::fortran_stdlib
blas
lapack
)
add_executable(${LINKER}
src/icon_usgs_linker.f90
src/io/read_data_mod.f90
src/io/write_data_mod.f90
src/io/netcdf_check_mod.f90
src/tools/const_mod.f90
src/tools/error_status_mod.f90
src/tools/utils_mod.f90
src/tools/triangle_mod.f90
src/var/topo_mod.f90
)
target_include_directories(${LINKER}
PUBLIC
"/usr/include"
${NETCDFF_INCLUDES_F90}
)
target_link_libraries(${LINKER}
PRIVATE
${NETCDFF_LIBRARIES_F90}
fortran_stdlib::fortran_stdlib
)