forked from IntelRealSense/librealsense
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·57 lines (49 loc) · 1.53 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
cmake_minimum_required (VERSION 3.8.0)
project (rs2driver)
# DEPS
set(OPENNI2_DIR "c:/Program Files/OpenNI2" CACHE FILEPATH "OpenNI2 SDK directory")
set(REALSENSE2_DIR "c:/Program Files (x86)/Intel RealSense SDK 2.0" CACHE FILEPATH "RealSense2 SDK directory")
# INCLUDE DIR
if (UNIX)
include_directories (${OPENNI2_DIR})
else ()
include_directories (${OPENNI2_DIR}/Include)
endif ()
include_directories (${REALSENSE2_DIR}/include)
include_directories (src)
# LINK DIR
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
link_directories (${REALSENSE2_DIR}/lib/x64)
elseif (CMAKE_SIZEOF_VOID_P EQUAL 4)
link_directories (${REALSENSE2_DIR}/lib/x86)
endif ()
# OUTPUT DIR
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/_out)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/_out)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/_out)
# SOURCE FILES
set (INCLUDE_FILES
src/Rs2Base.h
src/Rs2Stream.h
src/Rs2Device.h
src/Rs2Driver.h
src/Profiler.h
src/Profiler.inl
)
set (SRC_FILES
src/Rs2Base.cpp
src/Rs2Stream.cpp
src/Rs2StreamProps.cpp
src/Rs2Device.cpp
src/Rs2DeviceProps.cpp
src/Rs2Driver.cpp
)
# FLAGS
if(MSVC)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /Ot /GL /GF /MD /GS- /Gy /fp:fast /arch:AVX2")
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SUBSYSTEM:WINDOWS")
endif()
# LINK
add_library (rs2driver SHARED ${INCLUDE_FILES} ${SRC_FILES})
target_link_libraries (rs2driver realsense2)