-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
137 lines (114 loc) · 4.08 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
cmake_minimum_required(VERSION 3.12)
project(OsmElevation)
# C++ Versions
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Check compiler versions:
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# Check version. If empty, warn. If too old, error out:
if("${CMAKE_CXX_COMPILER_VERSION}" STREQUAL "")
message(WARNING "GCC Compiler version is unknown, proceed at your own risk!")
elseif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
message(FATAL_ERROR "GCC compiler version must be at least 4.8!")
endif()
endif()
###############################################################################
##### CPPLINT #####
###############################################################################
set(CPPLINT "${CMAKE_SOURCE_DIR}/cpplint.py")
include(cmake/cpplint.cmake)
cpplint_add_subdirectory("src")
set(CPPLINT_PROJECT_ROOT "src")
###############################################################################
##### Essential settings #####
###############################################################################
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
set(DIRECTORY_WITH_TEST_DATA "${CMAKE_SOURCE_DIR}/test/test_files/")
add_compile_options(-Ofast -Wall -Wno-format-extra-args -Wextra -Wformat-nonliteral -Wformat-security -Wformat=2 -Wextra -Wno-implicit-fallthrough -pedantic)
add_compile_options(-march=native -flto)
################################
# GTEST
################################
add_subdirectory(third_party/googletest/googletest)
include_directories(third_party/googletest/googletest/include)
################################
# UTSAlgorithms
################################
add_library(utsalgorithms
third_party/utsAlgorithms/ema.h third_party/utsAlgorithms/ema.h
third_party/utsAlgorithms/rolling.h third_party/utsAlgorithms/rolling.c
third_party/utsAlgorithms/sma.h third_party/utsAlgorithms/sma.c)
target_link_libraries(utsalgorithms)
include_directories(third_party/utsAlgorithms)
################################
# BOOST
################################
find_package(Boost REQUIRED)
include_directories(${Boost_INCLUDE_DIR})
################################
# EXPAT
################################
find_package(EXPAT REQUIRED)
################################
# BZIP2
################################
find_package(BZip2 REQUIRED)
################################
# ZLIB
################################
find_package(ZLIB REQUIRED)
################################
# PROTOZERO
################################
find_package(Protozero REQUIRED)
################################
# LIBOSMIUM
################################
find_package(Osmium REQUIRED)
include_directories(SYSTEM ${OSMIUM_INCLUDE_DIRS})
################################
# LIBZIP
################################
find_package(LibZip REQUIRED)
include_directories(SYSTEM ${LIBZIP_INCLUDE_DIR})
###############################################################################
##### Actual project configuration #####
###############################################################################
include_directories(src)
add_subdirectory(src/util)
add_subdirectory(src/writer)
add_subdirectory(src/parser)
add_subdirectory(src/osmelevation/elevation)
add_subdirectory(src/osmelevation/osm)
add_subdirectory(src/correctosmelevation/osm)
add_subdirectory(src/correctosmelevation/correct)
add_executable(osmelevation src/OsmElevationMain.cpp)
add_executable(correctosmelevation src/CorrectOsmElevationMain.cpp)
target_link_libraries(osmelevation
osmelevationosm
osmelevationelevation
parser
writer
util
${LIBZIP_LIBRARY}
${OSMIUM_LIBRARIES}
${EXPAT_LIBRARIES}
${BZIP2_LIBRARIES}
${ZLIB_LIBRARIES}
-lpthread)
target_link_libraries(correctosmelevation
correctelevationosm
correctelevationcorrect
utsalgorithms
parser
osmhandler
writer
util
${LIBZIP_LIBRARY}
${OSMIUM_LIBRARIES}
${EXPAT_LIBRARIES}
${BZIP2_LIBRARIES}
${ZLIB_LIBRARIES}
-lpthread)
enable_testing()
add_subdirectory(test)