-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
66 lines (51 loc) · 1.84 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
cmake_minimum_required(VERSION 2.8.3)
project(kinfu)
find_package(catkin REQUIRED
COMPONENTS message_generation roscpp std_srvs std_msgs sensor_msgs dynamic_reconfigure tf image_transport)
#include_directories(${PCL_INCLUDE_DIRS})
find_package(Eigen3 REQUIRED)
include_directories(${EIGEN_INCLUDE_DIRS})
add_definitions(${EIGEN_DEFINITIONS})
find_package(VTK REQUIRED)
include_directories(${VTK_INCLUDE_DIRS})
find_package(PCL 1.7.0 REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
#add dynamic reconfigure api
generate_dynamic_reconfigure_options(cfg/dyn_config.cfg)
include_directories(include cfg/cpp)
#### Freenect2
find_package(freenect2)
IF(freenect2_FOUND)
include_directories(${freenect2_INCLUDE_DIRS})
find_package(OpenCV REQUIRED core features2d)
include_directories(${OpenCV_INCLUDE_DIRS})
ELSE(freenect2_FOUND)
add_definitions(-DCOMPILE_WITHOUT_freenect2)
ENDIF(freenect2_FOUND)
#### Cuda
find_package(CUDA)
if (CUDA_FOUND)
message(" * CUDA ${CUDA_VERSION} was found")
include(FindCUDA)
include_directories(${CUDA_INCLUDE_DIRS})
else(CUDA_FOUND)
message(" * CUDA is not found")
message(FATAL_ERROR "Not all CUDA libraries are found")
endif(CUDA_FOUND)
catkin_package(
CATKIN_DEPENDS message_runtime std_msgs sensor_msgs dynamic_reconfigure
)
add_executable(kinfuLS src/kinfuLS.cpp)
add_dependencies(kinfuLS ${PROJECT_NAME}_gencfg)
target_link_libraries(kinfuLS boost_system boost_signals)
target_link_libraries(kinfuLS ${catkin_LIBRARIES})
target_link_libraries(kinfuLS ${CUDA_LIBRARIES})
target_link_libraries(kinfuLS ${PCL_LIBRARIES})
IF(freenect2_FOUND)
target_link_libraries(kinfuLS ${freenect2_LIBRARY})
set(OpenCV_LIBS opencv_core opencv_features2d)
target_link_libraries(kinfuLS ${OpenCV_LIBS})
ENDIF()
set(CMAKE_CXX_FLAGS "--std=c++11")