-
Notifications
You must be signed in to change notification settings - Fork 26
/
Skip-building-main-library.patch
136 lines (121 loc) · 4.37 KB
/
Skip-building-main-library.patch
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
From 59580857b7c749e5bc75adcb4c8449bb09dba513 Mon Sep 17 00:00:00 2001
From: Scott Ware <scott.r.ware@intel.com>
Date: Tue, 28 Jan 2020 15:55:18 +0000
Subject: [PATCH 3/3] Skip building main library
Signed-off-by: Scott Ware <scott.r.ware@intel.com>
---
CMake/global_config.cmake | 23 -----------------------
CMakeLists.txt | 19 -------------------
wrappers/python/CMakeLists.txt | 16 ++++++++++++----
3 files changed, 12 insertions(+), 46 deletions(-)
diff --git a/CMake/global_config.cmake b/CMake/global_config.cmake
index 0cdc748..2300cfa 100644
--- a/CMake/global_config.cmake
+++ b/CMake/global_config.cmake
@@ -18,9 +18,6 @@ if(ENABLE_CCACHE)
endif()
macro(global_set_flags)
- set(LRS_TARGET realsense2)
- set(LRS_LIB_NAME ${LRS_TARGET})
-
add_definitions(-DELPP_THREAD_SAFE)
add_definitions(-DELPP_NO_DEFAULT_LOG_FILE)
@@ -68,26 +65,6 @@ macro(global_set_flags)
add_definitions(-D${BACKEND} -DUNICODE)
endmacro()
-macro(global_target_config)
- target_link_libraries(${LRS_TARGET} PRIVATE realsense-file ${CMAKE_THREAD_LIBS_INIT})
-
- include_directories(${LRS_TARGET} src)
-
- set_target_properties (${LRS_TARGET} PROPERTIES FOLDER Library)
-
- target_include_directories(${LRS_TARGET}
- PRIVATE
- ${ROSBAG_HEADER_DIRS}
- ${BOOST_INCLUDE_PATH}
- ${LZ4_INCLUDE_PATH}
- ${LIBUSB_LOCAL_INCLUDE_PATH}
- PUBLIC
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
- $<INSTALL_INTERFACE:include>
- PRIVATE ${USB_INCLUDE_DIRS}
- )
-endmacro()
-
macro(add_tm2)
message(STATUS "Building with TM2")
add_subdirectory(third-party/libtm)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 16ced1b..7320459 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -43,29 +43,10 @@ os_set_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}.${REALSENSE_VERSION_MINOR}")
-
-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()
-
-include(CMake/install_config.cmake)
-
add_subdirectory(wrappers)
if (BUILD_EXAMPLES AND BUILD_GLSL_EXTENSIONS)
diff --git a/wrappers/python/CMakeLists.txt b/wrappers/python/CMakeLists.txt
index a070973..52d0018 100644
--- a/wrappers/python/CMakeLists.txt
+++ b/wrappers/python/CMakeLists.txt
@@ -7,7 +7,15 @@ if (NOT BUILD_PYTHON_BINDINGS)
message(WARNING "Python Bindings being built despite unset option because they are required for python documentation")
endif()
-set(DEPENDENCIES realsense2)
+find_package(PkgConfig)
+if(NOT PKG_CONFIG_FOUND)
+ message(FATAL_ERROR "\n\n PkgConfig package is missing!\n\n")
+endif()
+
+pkg_search_module(REALSENSE2 REQUIRED realsense2)
+if(NOT REALSENSE2_FOUND)
+ message( FATAL_ERROR "Failed to find realsense2" )
+endif()
add_subdirectory(third_party/pybind11)
@@ -30,7 +38,7 @@ set(PYRS_CPP
)
pybind11_add_module(pyrealsense2 SHARED python.hpp ${PYRS_CPP})
-target_link_libraries(pyrealsense2 PRIVATE ${DEPENDENCIES})
+target_link_libraries(pyrealsense2 PRIVATE ${REALSENSE2_LIBRARIES})
set_target_properties(pyrealsense2 PROPERTIES VERSION
${REALSENSE_VERSION_STRING} SOVERSION "${REALSENSE_VERSION_MAJOR}.${REALSENSE_VERSION_MINOR}")
set_target_properties(pyrealsense2 PROPERTIES FOLDER Wrappers/python)
@@ -125,7 +133,7 @@ set_target_properties(pybackend2 PROPERTIES
VERSION ${REALSENSE_VERSION_STRING}
SOVERSION ${REALSENSE_VERSION_MAJOR})
set_target_properties(pybackend2 PROPERTIES FOLDER Wrappers/python)
-include_directories(pybackend2 ../../include)
+include_directories(pybackend2 ../../include ../../src)
install(TARGETS pybackend2
EXPORT realsense2Targets
@@ -136,4 +144,4 @@ install(TARGETS pybackend2
if (BUILD_PYTHON_DOCS)
add_subdirectory(docs)
-endif()
\ No newline at end of file
+endif()
--
2.7.4