-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
63 lines (52 loc) · 2.28 KB
/
CMakeLists.txt
File metadata and controls
63 lines (52 loc) · 2.28 KB
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
# Copyright (C) 2017 Sven Willner <sven.willner@pik-potsdam.de>
#
# This file is part of flood-processing.
#
# flood-processing is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# flood-processing is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with flood-processing. If not, see <http://www.gnu.org/licenses/>.
cmake_minimum_required(VERSION 2.8)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
include(cmake/helpers.cmake)
include(cmake/libraries.cmake)
set_default_build_type(Release)
project(flood_processing)
file(GLOB MODULE_SOURCES src/modules/*.cpp)
add_executable(flood_processing src/main.cpp ${MODULE_SOURCES})
target_include_directories(flood_processing PRIVATE include lib/lmoments/include lib/cpp-library)
target_compile_options(flood_processing PRIVATE -std=c++11)
set_advanced_cpp_warnings(flood_processing)
set_build_type_specifics(flood_processing)
add_git_version(flood_processing
FALLBACK_VERSION 1.0.0)
option(PARALLELIZATION "" ON)
if(PARALLELIZATION)
find_package(OpenMP REQUIRED)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
option(WITH_GDAL "" OFF)
if(WITH_GDAL)
#include GDAL library
find_package(GDAL REQUIRED)
message(STATUS "GDAL include directory: ${GDAL_INCLUDE_DIR}")
message(STATUS "GDAL library: ${GDAL_LIBRARY}")
mark_as_advanced(GDAL_CONFIG GDAL_INCLUDE_DIR GDAL_LIBRARY)
target_link_libraries(flood_processing gdal)
target_include_directories(flood_processing PRIVATE ${GDAL_INCLUDE_DIR})
target_compile_definitions(flood_processing PRIVATE FLOOD_PROCESSING_WITH_GDAL)
endif()
include(lib/settingsnode/settingsnode.cmake)
include_settingsnode(flood_processing)
include_netcdf_cxx4(flood_processing ON v4.3.0)
include_yaml_cpp(flood_processing ON "yaml-cpp-0.6.2")
add_cpp_tools(flood_processing)