-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
93 lines (76 loc) · 2.2 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
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
cmake_minimum_required(VERSION 2.8.3)
project(d1200camera)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
function(checkPackage package customMessage)
set(varName "${package}_FOUND")
if (NOT "${${varName}}")
string(REPLACE "_" "-" aptPackage ${package})
if("${customMessage}" STREQUAL "")
message(FATAL_ERROR "\n\n ${package} is missing, please try to install it with:\n sudo apt-get install ros-$(rosversion -d)-${aptPackage}\n\n")
else()
message(FATAL_ERROR "\n\n ${customMessage} \n\n")
endif()
endif()
endfunction(checkPackage)
find_package(catkin REQUIRED COMPONENTS
pcl_conversions
pcl_ros
cv_bridge
image_transport
message_generation
nodelet
roscpp
sensor_msgs
std_msgs
tf
)
checkPackage("cv_bridge" "")
checkPackage("image_transport" "")
checkPackage("message_generation" "")
checkPackage("nodelet" "")
checkPackage("roscpp" "")
checkPackage("sensor_msgs" "")
checkPackage("std_msgs" "")
checkPackage("tf" "")
catkin_package(
CATKIN_DEPENDS pcl_conversions pcl_ros cv_bridge image_transport message_runtime nodelet roscpp sensor_msgs std_msgs tf
)
get_filename_component(SDK_DIR "${PROJECT_SOURCE_DIR}/../../../.." ABSOLUTE)
LIST(APPEND CMAKE_PREFIX_PATH ${SDK_DIR}/_install/lib/cmake)
find_package(mynteyed REQUIRED)
message(STATUS "Found mynteye: ${mynteye_VERSION}")
if(NOT mynteyed_WITH_OPENCV)
message(FATAL_ERROR "Please install OpenCV, then rebuild mynteye with it."
" Because these samples use OpenCV to show images.")
endif()
find_package(OpenCV REQUIRED)
if(OpenCV_FOUND)
message(STATUS "OpenCV is found.")
set(WITH_OPENCV TRUE)
add_definitions(-DWITH_OPENCV)
message(STATUS "Defined WITH_OPENCV.")
endif()
# targets
add_compile_options(-std=c++11)
include_directories(
${catkin_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
)
set(LINK_LIBRARIES
${catkin_LIBRARIES}
${OpenCV_LIBS}
${PCL_LIBRARIES}
mynteye_depth
)
add_executable(mynteye_d1200_node src/mynteye_d1200_full_node.cc)
target_link_libraries(mynteye_d1200_node ${LINK_LIBRARIES})
# install
install(DIRECTORY launch
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)
install(DIRECTORY rviz
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)