-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathCMakeLists.txt
73 lines (59 loc) · 1.88 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
cmake_minimum_required(VERSION 2.8.3)
project(hokuyo_node)
find_package(Boost REQUIRED COMPONENTS system thread)
# Utilities that use log4cxx - getID and getFirmwareVersion
find_library(LOG4CXX_LIBRARY log4cxx)
if(NOT LOG4CXX_LIBRARY)
message(FATAL_ERROR "Couldn't find log4cxx library")
endif()
# Load catkin and all dependencies required for this package
find_package(catkin REQUIRED
COMPONENTS
diagnostic_updater
driver_base
dynamic_reconfigure
rosconsole
roscpp
self_test
sensor_msgs
)
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
include_directories(include ${catkin_INCLUDE_DIRS})
# Dynamic reconfigure support
generate_dynamic_reconfigure_options(cfg/Hokuyo.cfg)
# Export with catkin_package
catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS rosconsole
LIBRARIES libhokuyo
)
# Hokuyo library
add_library(libhokuyo src/hokuyo.cpp)
target_link_libraries(libhokuyo ${rosconsole_LIBRARIES})
# hokuyo_node
add_executable(hokuyo_node src/hokuyo_node.cpp)
add_dependencies(hokuyo_node ${PROJECT_NAME}_gencfg)
target_link_libraries(hokuyo_node
libhokuyo
${Boost_LIBRARIES}
${catkin_LIBRARIES}
)
add_executable(getID src/getID.cpp)
target_link_libraries(getID libhokuyo ${LOG4CXX_LIBRARY} ${catkin_LIBRARIES})
add_executable(getFirmwareVersion src/getFirmwareVersion.cpp)
target_link_libraries(getFirmwareVersion
libhokuyo
${LOG4CXX_LIBRARY}
${catkin_LIBRARIES}
)
# Install targets
install(TARGETS libhokuyo DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)
install(TARGETS hokuyo_node getID getFirmwareVersion
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(FILES test/TODO test/unplug_test.launch COPYING.lib hokuyo_test.launch hokuyo_test.vcg hokuyo_test_intensity.launch
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)