-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
60 lines (50 loc) · 1.57 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
cmake_minimum_required(VERSION 3.16)
set(CMAKE_INSTALL_PREFIX /opt/iot)
project(rpi_robot)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
# libs {
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME ON)
add_definitions(-DBOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED -DBOOST_STACKTRACE_USE_ADDR2LINE)
find_package(Boost 1.83 REQUIRED)
find_package(fmt REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(nlohmann_json REQUIRED)
link_directories(${Boost_LIBRARY_DIRS})
# }
include_directories(
${fmt_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${nlohmann_json_INCLUDE_DIRS}
${OpenSSL_INCLUDE_DIRS}
core-utils/event-bus/src
core-utils/logging/src
core-utils/core/src
core-utils/application/src
core-utils/network/src
core-utils/iot-platform/src
core-utils/joystick/src
)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(PROPERTIES_DIR ${PROJECT_BINARY_DIR}/etc)
set(PLUGINS_DIR ${PROJECT_BINARY_DIR}/lib)
set(VAR_DIR ${PROJECT_BINARY_DIR}/var)
add_subdirectory(core-utils)
add_subdirectory(monitor)
if (APPLE)
message(STATUS "Apple build")
elseif (UNIX AND NOT APPLE)
message(STATUS "Unix build")
find_library(GPIOD gpiod)
if (NOT GPIOD)
message(STATUS "gpiod library not found - can't build service app")
else ()
message(STATUS "service with GPIO")
add_subdirectory(service)
endif ()
message(STATUS "incubator with GPIO")
endif ()
add_subdirectory(registry)
add_subdirectory(incubator)