-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
40 lines (29 loc) · 957 Bytes
/
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
cmake_minimum_required(VERSION 3.18)
project(domain-tools VERSION 0.1.0 LANGUAGES Fortran)
# Find NetCDF
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
find_package(NetCDF COMPONENTS Fortran REQUIRED)
# Library targets
add_library(M_CLI2
external/M_CLI2/src/M_CLI2.F90
)
add_library(topography
src/utils.f90
src/vgrid.f90
src/topography.f90
src/gen_topo.f90
src/kdtree2.f90
)
target_link_libraries(topography PRIVATE M_CLI2 NetCDF::NetCDF_Fortran)
# Executables
add_executable(topogtools src/topogtools.f90)
target_link_libraries(topogtools PRIVATE topography M_CLI2)
add_executable(float_vgrid src/float_vgrid.f90)
target_link_libraries(float_vgrid PRIVATE topography
M_CLI2
NetCDF::NetCDF_Fortran)
# Installation
include(GNUInstallDirs)
install(TARGETS topogtools float_vgrid
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)