-
Notifications
You must be signed in to change notification settings - Fork 16
/
CMakeLists.txt
52 lines (38 loc) · 1.56 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
cmake_minimum_required(VERSION 3.5)
project(airmap C CXX)
set(AIRMAPD_VERSION_MAJOR 0)
set(AIRMAPD_VERSION_MINOR 0)
set(AIRMAPD_VERSION_PATCH 1)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
option(AIRMAP_ENABLE_NETWORK_TESTS "enable tests requiring network access" ON)
option(AIRMAP_ENABLE_GRPC "Enable libraries/executables requiring gRPC" OFF)
option(AIRMAP_ENABLE_QT "Enable libraries/executables requiring Qt5" OFF)
if (AIRMAP_ENABLE_GRPC)
add_definitions(-DAIRMAP_ENABLE_GRPC)
endif ()
find_package(Git)
if (GIT_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE AIRMAPD_VERSION_GIT_REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "Building in git revision ${AIRMAPD_VERSION_GIT_REVISION}")
else()
set(AIRMAPD_VERSION_GIT_REVISION "n/a")
message(STATUS "Executable git is missing, choosing default value for git revision")
endif()
string(TIMESTAMP AIRMAPD_VERSION_BUILD_TIMESTAMP "%Y-%m-%dT%H:%M:%S.000000Z" UTC)
message(STATUS "Building in build timestamp ${AIRMAPD_VERSION_BUILD_TIMESTAMP}")
# Detecting the platform at build time and exposing
# information on the platform to the platform
set(AIRMAP_PLATFORM "null")
if (UNIX)
# We are treating OS X as a proper Linux-like operating system and store
# configuration files according to the XDG directory standard.
set(AIRMAP_PLATFORM "linux")
endif()
message(STATUS "Enabling platform ${AIRMAP_PLATFORM}")
include(external.cmake)
include(airmapd.cmake)