This repository has been archived by the owner on Jun 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
56 lines (45 loc) · 1.64 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
cmake_minimum_required(VERSION 3.12)
project(graphs CXX)
set(SOURCE ${PROJECT_SOURCE_DIR}/src)
set(INCLUDE ${PROJECT_SOURCE_DIR}/include)
set(DATA ${PROJECT_SOURCE_DIR}/data)
set(GRAPHS_SOURCES
${SOURCE}/graph.cpp
${SOURCE}/map.cpp
${SOURCE}/geojson.cpp
${SOURCE}/dmatrix.cpp
${SOURCE}/clustering.cpp
${SOURCE}/color.cpp
${SOURCE}/assessment.cpp
${SOURCE}/planning.cpp
${SOURCE}/main.cpp
)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
# Define build type.
set(CMAKE_BUILD_TYPE "Debug")
add_executable(graphs ${GRAPHS_SOURCES})
target_include_directories(graphs PRIVATE ${SOURCE})
target_include_directories(graphs PRIVATE ${INCLUDE})
set_property(TARGET graphs PROPERTY CXX_STANDARD 17)
# Required dynamic-link libraries.
find_package(fmt REQUIRED)
find_package(Osmium REQUIRED COMPONENTS pbf)
find_package(ZLIB REQUIRED)
find_package(Threads REQUIRED)
find_package(Boost REQUIRED serialization)
# Move necessary data files to build directory.
configure_file(data/Graph.csv ${CMAKE_CURRENT_BINARY_DIR}/Graph.csv COPYONLY)
configure_file(data/NNMap.pbf ${CMAKE_CURRENT_BINARY_DIR}/NNMap.pbf COPYONLY)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
configure_file(data/VNMap.pbf ${CMAKE_CURRENT_BINARY_DIR}/VNMap.pbf COPYONLY)
endif ()
target_compile_options(graphs PRIVATE -Werror -Wall -Wextra)
if (CMAKE_BUILD_TYPE EQUAL "Release")
target_compile_options(graphs PRIVATE -O3)
endif ()
target_link_libraries(graphs PUBLIC
fmt::fmt
${OSMIUM_IO_LIBRARIES}
${ZLIB_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${Boost_LIBRARIES})