-
Notifications
You must be signed in to change notification settings - Fork 16
/
CMakeLists.txt
110 lines (86 loc) · 3.47 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
cmake_minimum_required(VERSION 3.7)
# if using vcpkg, configure overlay ports (that are not available in vcpkg prime)
if (${CMAKE_TOOLCHAIN_FILE} MATCHES ".*vcpkg.cmake.*")
message(STATUS "Building with vcpkg toolchain.")
set(USING_VCPKG ON)
set(VCPKG_OVERLAY_PORTS ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/ports)
endif()
# Main PROJECT definition
project(
rocky
VERSION 0.5.2
DESCRIPTION "Rocky by Pelican Mapping"
HOMEPAGE_URL https://github.com/pelicanmapping/rocky
LANGUAGES CXX C
)
# please update this with each ABI change!!
set(PROJECT_VERSION_ABI 113)
# require C++17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# define that we can use when checking for conditional features in the SDK build
add_definitions(-DROCKY_BUILDING_SDK)
# option to build shared or static libs
option(ROCKY_BUILD_SHARED_LIBS "Build shared libraries" ON)
mark_as_advanced(ROCKY_BUILD_SHARED_LIBS)
# whether to append the ABI version to shared library filenames
option(ROCKY_APPEND_SO_VERSION "Whether to append the ABI version to libraries" ON)
mark_as_advanced(ROCKY_APPEND_SO_VERSION)
# folder for additional cmake includes
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# platform-specific settings
include(platform)
# temporary folder to hold build-time header compilation (.in files built with compile_files)
set(ROCKY_BUILDTIME_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/build_include")
include_directories(${ROCKY_BUILDTIME_INCLUDE_DIR})
# temporary folder to hold shared resources (like shaders) for use whrn running from the IDE
set(ROCKY_BUILDTIME_SHARE_DIR "${CMAKE_CURRENT_BINARY_DIR}/build_share")
# platform specific
include(platform)
# set up standard install folder names
# https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html
include(GNUInstallDirs)
# load utilities
include("cmake/install-export-files.cmake")
# optional modules
option(ROCKY_RENDERER_VSG "Build the VSG/Vulkan Rendering" ON)
option(ROCKY_SUPPORTS_HTTPLIB "Support HTTP with the lightweight cpp-httplib library" ON)
option(ROCKY_SUPPORTS_CURL "Support HTTP with the CURL library" OFF)
option(ROCKY_SUPPORTS_HTTPS "Support HTTPS (requires openssl)" ON)
option(ROCKY_SUPPORTS_TMS "Support OSGeo TileMapService and generic 'XYZ' maps" ON)
option(ROCKY_SUPPORTS_GDAL "Support GeoTIFF, WMS, WMTS, and other GDAL formats (requires gdal)" ON)
option(ROCKY_SUPPORTS_MBTILES "Support MBTiles databases with extended spatial profile support (requires sqlite3, zlib)" ON)
option(ROCKY_SUPPORTS_AZURE "Support Azure Maps (subscription required)" ON)
option(ROCKY_SUPPORTS_BING "Support Bing Maps (subscription required)" ON)
option(ROCKY_SUPPORTS_IMGUI "Build ImGui demos" ON)
option(ROCKY_SUPPORTS_QT "Build Qt demos" OFF)
mark_as_advanced(ROCKY_RENDERER_VSG)
mark_as_advanced(ROCKY_SUPPORTS_HTTPLIB)
mark_as_advanced(ROCKY_SUPPORTS_CURL)
set(BUILD_WITH_JSON ON)
if(ROCKY_SUPPORTS_GDAL)
set(BUILD_WITH_GDAL ON)
endif()
if(ROCKY_SUPPORTS_HTTPLIB)
set(BUILD_WITH_HTTPLIB ON)
endif()
if(ROCKY_SUPPORTS_HTTPS)
set(BUILD_WITH_OPENSSL ON)
endif()
if (ROCKY_SUPPORTS_MBTILES)
set(BUILD_WITH_SQLITE3 ON)
set(BUILD_WITH_ZLIB ON)
endif()
if(ROCKY_SUPPORTS_QT)
set(BUILD_WITH_QT ON)
endif()
if(ROCKY_SUPPORTS_CURL)
if(BUILD_WITH_HTTPLIB)
message(WARNING "You selected both HTTPLIB and CURL. These are mutually exclusive, so I am disabling CURL.")
else()
set(BUILD_WITH_CURL ON)
endif()
endif()
# source code
add_subdirectory(src)