-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
40 lines (37 loc) · 1.41 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
if(NOT DEFINED RealSense_LIB)
if(WIN32)
include_directories("$ENV{LIBRS}/include")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
find_library(RealSense_LIB realsense "$ENV{LIBRS}/bin/x64" NO_DEFAULT_PATH)
find_library(RealSense_LIB_DEBUG realsense-d "$ENV{LIBRS}/bin/x64" NO_DEFAULT_PATH)
else()
find_library(RealSense_LIB realsense "$ENV{LIBRS}/bin/Win32" NO_DEFAULT_PATH)
find_library(RealSense_LIB_DEBUG realsense-d "$ENV{LIBRS}/bin/Win32" NO_DEFAULT_PATH)
endif()
else()
set(RealSense_LIB realsense)
endif()
else()
if(NOT DEFINED RealSense_LIB_DEBUG)
set(RealSense_LIB_DEBUG ${RealSense_LIB})
endif()
endif()
option(BUILD_SHARED_RSWrapper "Build RSWrapper as shared libraries" OFF)
if(BUILD_SHARED_RSWrapper)
set(RSWrapper_TYPE SHARED)
add_definitions(-DRSWrapper_SHARED)
else()
set(RSWrapper_TYPE STATIC)
endif()
file(GLOB SRCS "${CMAKE_CURRENT_LIST_DIR}/RSWrapper.cpp")
file(GLOB HDRS "${CMAKE_CURRENT_LIST_DIR}/RSWrapper.hpp")
add_library(RSWrapper ${RSWrapper_TYPE} ${SRCS} ${HDRS})
target_include_directories(RSWrapper PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>
)
if(WIN32)
target_link_libraries(RSWrapper ${OpenCV_LIBS})
target_link_libraries(RSWrapper optimized ${RealSense_LIB} debug ${RealSense_LIB_DEBUG})
else()
target_link_libraries(RSWrapper ${OpenCV_LIBS} ${RealSense_LIB})
endif()