forked from clearpathrobotics/LMS1xx
-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
77 lines (56 loc) · 2.82 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
cmake_minimum_required(VERSION 2.8.3)
project(lms1xx)
add_compile_options(-std=c++11)
# Build ROS-independent library.
find_package(console_bridge REQUIRED)
include_directories(include ${console_bridge_INCLUDE_DIRS})
# CoLaA Library abstracting protocol and implementing LMS1xx communication
add_library(CoLaA src/colaa.cpp src/parse_helpers.cpp)
target_link_libraries(CoLaA ${console_bridge_LIBRARIES})
# Specialisations for LMS5xx series scanners
add_library(LMS5xx src/lms5xx.cpp)
target_link_libraries(LMS5xx CoLaA ${console_bridge_LIBRARIES})
add_library(MRS1000 src/mrs1000.cpp)
target_link_libraries(MRS1000 CoLaA ${console_bridge_LIBRARIES})
# Regular catkin package follows.
find_package(catkin REQUIRED COMPONENTS roscpp sensor_msgs)
catkin_package(CATKIN_DEPENDS roscpp sensor_msgs)
include_directories(include ${catkin_INCLUDE_DIRS})
add_executable(LMS1xx_node src/lms1xx_node.cpp)
target_link_libraries(LMS1xx_node CoLaA ${catkin_LIBRARIES})
add_dependencies(LMS1xx_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_executable(MRS1000_node src/mrs1000_node.cpp src/colaa_conversion.cpp)
target_link_libraries(MRS1000_node MRS1000 ${catkin_LIBRARIES})
add_dependencies(MRS1000_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_executable(LMS5xx_node src/lms5xx_node.cpp src/colaa_conversion.cpp)
target_link_libraries(LMS5xx_node LMS5xx ${catkin_LIBRARIES})
add_dependencies(LMS5xx_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
install(TARGETS CoLaA LMS5xx MRS1000 LMS1xx_node LMS5xx_node MRS1000_node
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(DIRECTORY meshes launch urdf
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
install(PROGRAMS scripts/find_sick scripts/set_sick_ip
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
if (CATKIN_ENABLE_TESTING)
catkin_add_gtest(test_buffer test/test_buffer.cpp)
target_link_libraries(test_buffer ${catkin_LIBRARIES})
catkin_add_gtest(test_colaa test/test_colaa.cpp)
target_link_libraries(test_colaa CoLaA ${catkin_LIBRARIES})
add_dependencies(test_colaa CoLaA)
# Copy test data
file(COPY test/mrs1000.txt DESTINATION ${PROJECT_BINARY_DIR}/test)
catkin_add_gtest(test_mrs1000_scandata test/mrs1000_scandata_test.cpp)
target_link_libraries(test_mrs1000_scandata CoLaA ${catkin_LIBRARIES})
add_dependencies(test_mrs1000_scandata CoLaA)
catkin_add_gtest(parse_helper_test test/parse_helper_test.cpp src/parse_helpers.cpp)
find_package(roslint REQUIRED)
roslint_cpp()
#roslint_add_test()
find_package(roslaunch REQUIRED)
roslaunch_add_file_check(launch/LMS1xx.launch)
roslaunch_add_file_check(launch/LMS5xx.launch)
roslaunch_add_file_check(launch/MRS1000.launch)
endif()