forked from systemed/tilemaker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
51 lines (36 loc) · 1.74 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
cmake_minimum_required(VERSION 2.8)
project(tilemaker)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
if("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}")
message(FATAL_ERROR "In-source builds are not allowed, please use a separate build directory.")
endif()
include_directories(include)
include_directories(${CMAKE_BINARY_DIR}) # for generated files
find_package(Boost 1.56 REQUIRED COMPONENTS system filesystem program_options)
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
find_package(Protobuf REQUIRED)
include_directories(${PROTOBUF_INCLUDE_DIR})
find_package(SQLite3 REQUIRED)
include_directories(${SQLITE3_INCLUDE_DIR})
find_package(libshp REQUIRED)
include_directories(${LIBSHP_INCLUDE_DIR})
find_package(Lua REQUIRED)
include_directories(${LUA_INCLUDE_DIR})
find_package(ZLIB REQUIRED)
include_directories(${ZLIB_INCLUDE_DIR})
if(MSVC)
add_definitions(-D_USE_MATH_DEFINES)
set(THREAD_LIB "")
else()
add_definitions(-std=c++11)
set(THREAD_LIB pthread)
endif()
ADD_CUSTOM_COMMAND(OUTPUT vector_tile.pb.cc vector_tile.pb.h
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
ARGS --cpp_out ${CMAKE_BINARY_DIR} -I ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/include/vector_tile.proto)
ADD_CUSTOM_COMMAND(OUTPUT osmformat.pb.cc osmformat.pb.h
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
ARGS --cpp_out ${CMAKE_BINARY_DIR} -I ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/include/osmformat.proto)
add_executable(tilemaker vector_tile.pb.cc osmformat.pb.cc src/tilemaker.cpp)
target_link_libraries(tilemaker ${Boost_LIBRARIES} ${PROTOBUF_LIBRARY} ${LIBSHP_LIBRARIES} ${SQLITE3_LIBRARIES} ${LUA_LIBRARIES} ${ZLIB_LIBRARY} ${THREAD_LIB})
install(TARGETS tilemaker RUNTIME DESTINATION bin)