-
Notifications
You must be signed in to change notification settings - Fork 17
/
CMakeLists.txt
53 lines (41 loc) · 1.93 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
cmake_minimum_required(VERSION 3.5.1)
project(mbtilesCpp)
set(CMAKE_CXX_STANDARD 14)
set(SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/Source/vector_tile21/vector_tile.pb.cc
${CMAKE_CURRENT_LIST_DIR}/Include/vector_tile21/vector_tile.pb.h
${CMAKE_CURRENT_LIST_DIR}/Source/MBTileReader.cpp
${CMAKE_CURRENT_LIST_DIR}/Include/MBTileReader.h
${CMAKE_CURRENT_LIST_DIR}/Source/VectorTile.cpp
${CMAKE_CURRENT_LIST_DIR}/Include/VectorTile.h
${CMAKE_CURRENT_LIST_DIR}/cppGzip/DecodeGzip.cpp
${CMAKE_CURRENT_LIST_DIR}/cppGzip/DecodeGzip.h
${CMAKE_CURRENT_LIST_DIR}/cppGzip/EncodeGzip.cpp
${CMAKE_CURRENT_LIST_DIR}/cppGzip/EncodeGzip.h
${CMAKE_CURRENT_LIST_DIR}/cppGzip/HandleDeflate.h)
# Examples/example.cpp
# Examples/example2.cpp
#pull in some helpers
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(FindProtobuf)
include(FindZLIB)
#find sqlite
find_package (SQLite3)
add_library(mbtilesCpp ${SOURCE_FILES})
target_include_directories(mbtilesCpp PUBLIC ${CMAKE_CURRENT_LIST_DIR}/Include/)
target_include_directories(mbtilesCpp PUBLIC ${SQLITE3_INCLUDE_DIR})
target_include_directories(mbtilesCpp PUBLIC ${Protobuf_INCLUDE_DIR})
target_include_directories(mbtilesCpp PUBLIC ${ZLIB_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(mbtilesCpp ${SQLITE3_LIBRARY})
TARGET_LINK_LIBRARIES(mbtilesCpp ${PROTOBUF_LIBRARIES})
TARGET_LINK_LIBRARIES(mbtilesCpp ${ZLIB_LIBRARY})
add_executable(example1 Examples/example.cpp)
TARGET_LINK_LIBRARIES(example1 mbtilesCpp)
TARGET_LINK_LIBRARIES(example1 ${SQLITE3_LIBRARY})
TARGET_LINK_LIBRARIES(example1 ${PROTOBUF_LIBRARIES})
TARGET_LINK_LIBRARIES(example1 ${ZLIB_LIBRARY})
add_executable(example2 Examples/example2.cpp)
TARGET_LINK_LIBRARIES(example2 mbtilesCpp)
TARGET_LINK_LIBRARIES(example2 ${SQLITE3_LIBRARY})
TARGET_LINK_LIBRARIES(example2 ${PROTOBUF_LIBRARIES})
TARGET_LINK_LIBRARIES(example2 ${ZLIB_LIBRARY})