forked from vrabaud/nao_camera_to_delete
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
107 lines (87 loc) · 3.25 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
94
95
96
97
98
99
100
101
102
103
104
105
106
cmake_minimum_required(VERSION 2.8)
project(nao_camera)
# Tell CMake where to find "FindNAOqi.cmake"
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# Find catkin macros and libraries, also other catkin packages.
find_package(catkin REQUIRED COMPONENTS
camera_info_manager
diagnostic_updater
driver_base
dynamic_reconfigure
image_transport
nodelet
roscpp
sensor_msgs
tf)
find_package(NAOqi QUIET COMPONENTS
alcommon
alvision
alproxies
alerror
alvalue)
# deal with the Python code
catkin_python_setup()
# This driver uses Boost threads
find_package(Boost REQUIRED COMPONENTS thread program_options)
# auto-generate dynamic reconfiguration GUI before catkin_package()
generate_dynamic_reconfigure_options(cfg/NaoCamera.cfg)
catkin_package(CATKIN_DEPENDS
camera_info_manager
diagnostic_updater
dynamic_reconfigure
image_transport
nodelet
roscpp
tf
DEPENDS Boost
LIBRARIES src/naocamera_nodelet)
if( ${NAOqi_FOUND} AND ${Boost_FOUND} )
include_directories(
${catkin_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${NAOqi_INCLUDE_DIRS})
set(NAOCAMERA_SOURCES
src/nao_camera.cpp
src/nao_camera_node.cpp
src/nao_node.cpp)
add_executable(cameras ${NAOCAMERA_SOURCES})
target_link_libraries(cameras
${catkin_LIBRARIES}
${Boost_LIBRARIES}
${NAOqi_LIBRARIES})
add_dependencies(cameras ${catkin_EXPORTED_TARGETS})
install(TARGETS cameras
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} )
#### NODELET
# build and install the nodelet
add_library(naocamera_nodelet src/nodelet.cpp ${NAOCAMERA_SOURCES})
add_dependencies(naocamera_nodelet ${catkin_EXPORTED_TARGETS})
target_link_libraries(naocamera_nodelet
${catkin_LIBRARIES}
${NAOqi_LIBRARIES})
install(TARGETS naocamera_nodelet
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})
# install pluginlib definition for the nodelet
install(FILES naocamera_nodelet.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
install(FILES launch/nodelet_manager.launch launch/nodelet_standalone.launch launch/nodelet_pipeline.launch
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
####
else()
# not set as warning to not update the buildfarms
message(STATUS "-- Cannot find NAOqi C++ SDK! Set NAOqi_DIR to the SDK prefix to build the C++ nodes.")
message(STATUS "-- The Python nodes will still be installed and can be run provided NAOqi is in your PYTHONPATH.")
endif()
#And this will install python nodes
install(DIRECTORY nodes/
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
USE_SOURCE_PERMISSIONS)
# Instructions to install launch files
install(DIRECTORY launch/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch )
# Install config file (& ignore dynamic reconfigure files)
install(DIRECTORY cfg/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/config
PATTERN "*.cfg" EXCLUDE)