-
Notifications
You must be signed in to change notification settings - Fork 17
/
CMakeLists.txt
49 lines (33 loc) · 1.48 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
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(PCL_Kinect2SDK)
SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
IF(WIN32 OR win64)
SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll)
ELSE()
SET(CMAKE_FIND_LIBRARY_SUFFIXES .a)
ENDIF()
find_package(PCL 1.7 REQUIRED)
find_package( OpenCV REQUIRED )
add_subdirectory(src)
set(KinectSDK_INCLUDE "default value" CACHE PATH "Include directories for Kinect2 SDK")
set(KinectSDK_LIB "default value" CACHE PATH "Include directories for Kinect2 SDK")
include_directories(C:/opencv/build)
include_directories(${PCL_INCLUDE_DIRS})
include_directories(${PCL_Kinect2SDK_SOURCE_DIR}/include)
include_directories(${KinectSDK_INCLUDE})
link_directories(${PCL_LIBRARY_DIRS})
link_directories(${KinectSDK_LIB})
add_definitions(${PCL_DEFINITIONS})
file(GLOB_RECURSE PCL_Kinect2SDK_HEADERS include/*.h)
file(GLOB_RECURSE PCL_Kinect2SDK_SOURCES src/*.cpp)
set (PCL_Kinect2SDK_INCLUDE_DIRS "")
foreach (_headerFile ${PCL_Kinect2SDK_HEADERS})
get_filename_component(_dir ${_headerFile} PATH)
list (APPEND PCL_Kinect2SDK_INCLUDE_DIRS ${_dir})
endforeach()
list(REMOVE_DUPLICATES PCL_Kinect2SDK_INCLUDE_DIRS)
include_directories(${PCL_Kinect2SDK_INCLUDE_DIRS})
add_library(PCL_Kinect2SDK STATIC src/Microsoft_grabber2.cpp)
target_link_libraries (PCL_Kinect2SDK ${PCL_LIBRARIES} ${OpenCV_LIBS} Kinect20.lib)
add_executable (Test_SDK src/PCL_Kinect2SDK.cpp)
target_link_libraries (Test_SDK PCL_Kinect2SDK ${PCL_LIBRARIES} ${OpenCV_LIBS} Kinect20.lib)