forked from IntelRealSense/librealsense
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
74 lines (56 loc) · 1.81 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
# minimum required cmake version: 3.1.0
cmake_minimum_required(VERSION 3.1.0)
project(librealsense2 LANGUAGES CXX C)
# include librealsense general configuration
include(CMake/global_config.cmake)
config_cxx_flags()
# include os specific macros
# macro definition located at "CMake/global_config.cmake"
include(CMake/include_os.cmake)
# set os specific configuration flags
# macro definition located at "CMake/<OS>_config.cmake"
os_set_flags()
# set global configuration flags
# macro definition located at "CMake/global_config.cmake"
global_set_flags()
if(BUILD_SHARED_LIBS)
add_library(${LRS_TARGET} SHARED "")
else()
add_library(${LRS_TARGET} STATIC "")
endif()
# set library version
set_target_properties(${LRS_TARGET} PROPERTIES VERSION ${REALSENSE_VERSION_STRING} SOVERSION ${REALSENSE_VERSION_MAJOR})
# Checking Internet connection, as TM2 needs to download the FW from amazon cloud
if(BUILD_WITH_TM2)
include(CMake/tm2_connectivity_check.cmake)
endif()
include(include/CMakeLists.txt)
include(src/CMakeLists.txt)
include(third-party/CMakeLists.txt)
# configure the project according to OS specific requirments
# macro definition located at "CMake/<OS>_config.cmake"
os_target_config()
# global project configuration
# macro definition located at "CMake/global_config.cmake"
global_target_config()
option(BUILD_CV_KINFU_EXAMPLE "Build OpenCV KinectFusion example" OFF)
add_subdirectory(wrappers)
if((BUILD_EXAMPLES AND BUILD_GRAPHICAL_EXAMPLES))
if(WIN32)
add_subdirectory(third-party/glfw)
add_library(glfw ALIAS glfw3)
else()
find_package(glfw3 REQUIRED)
endif()
endif()
if(BUILD_EXAMPLES)
add_subdirectory(examples)
add_subdirectory(tools)
endif()
if(BUILD_UNIT_TESTS)
add_subdirectory(unit-tests)
endif()
if (BUILD_WITH_TM2)
add_tm2()
endif()
include(CMake/install_config.cmake)