forked from MaZderMind/osm-history-splitter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
122 lines (92 loc) · 3.46 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
#-----------------------------------------------------------------------------
#
# CMake Config
#
# osm-history-splitter
#
#-----------------------------------------------------------------------------
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
#-----------------------------------------------------------------------------
#
# Project version
#
#-----------------------------------------------------------------------------
project(osm-history-splitter)
set(OHS_VERSION_MAJOR 0)
set(OHS_VERSION_MINOR 0)
set(OHS_VERSION_PATCH 1)
set(OHS_VERSION
${OHS_VERSION_MAJOR}.${XXX_VERSION_MINOR}.${XXX_VERSION_PATCH})
set(AUTHOR "Peter Körner <[email protected]> and Jochen Topf <[email protected]>")
#-----------------------------------------------------------------------------
#
# Find external dependencies
#
#-----------------------------------------------------------------------------
find_package(Osmium COMPONENTS io geos)
include_directories(${OSMIUM_INCLUDE_DIRS})
#-----------------------------------------------------------------------------
#
# Decide which C++ version to use (Minimum/default: C++11).
#
#-----------------------------------------------------------------------------
if(NOT MSVC)
if(NOT USE_CPP_VERSION)
set(USE_CPP_VERSION c++11)
endif()
message(STATUS "Use C++ version: ${USE_CPP_VERSION}")
# following only available from cmake 2.8.12:
# add_compile_options(-std=${USE_CPP_VERSION})
# so using this instead:
add_definitions(-std=${USE_CPP_VERSION})
endif()
#-----------------------------------------------------------------------------
#
# Compiler and Linker flags
#
#-----------------------------------------------------------------------------
set(USUAL_COMPILE_OPTIONS "-O3 -g")
set(CMAKE_CXX_FLAGS_DEV "${USUAL_COMPILE_OPTIONS}"
CACHE STRING "Flags used by the compiler during developer builds."
FORCE)
set(CMAKE_EXE_LINKER_FLAGS_DEV ""
CACHE STRING "Flags used by the linker during developer builds."
FORCE)
mark_as_advanced(
CMAKE_CXX_FLAGS_DEV
CMAKE_EXE_LINKER_FLAGS_DEV
)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${USUAL_COMPILE_OPTIONS}"
CACHE STRING "Flags used by the compiler during RELWITHDEBINFO builds."
FORCE)
#-----------------------------------------------------------------------------
#
# Build Type
#
#-----------------------------------------------------------------------------
set(CMAKE_CONFIGURATION_TYPES "Debug Release RelWithDebInfo MinSizeRel Dev")
# In 'Dev' mode: compile with very strict warnings and turn them into errors.
if(CMAKE_BUILD_TYPE STREQUAL "Dev")
if(NOT MSVC)
add_definitions(-Werror -fno-omit-frame-pointer)
endif()
add_definitions(${OSMIUM_WARNING_OPTIONS})
endif()
# Force RelWithDebInfo build type if none was given
if(CMAKE_BUILD_TYPE)
set(build_type ${CMAKE_BUILD_TYPE})
else()
set(build_type "RelWithDebInfo")
endif()
set(CMAKE_BUILD_TYPE ${build_type}
CACHE STRING
"Choose the type of build, options are: ${CMAKE_CONFIGURATION_TYPES}."
FORCE)
#-----------------------------------------------------------------------------
add_definitions(${OSMIUM_WARNING_OPTIONS})
add_executable(osm-history-splitter splitter.cpp)
target_link_libraries(osm-history-splitter ${OSMIUM_LIBRARIES})
install(TARGETS osm-history-splitter DESTINATION bin)
#-----------------------------------------------------------------------------