-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
66 lines (54 loc) · 1.52 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(supermarket_cleaning_robot)
## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++11)
## Find catkin and any catkin packages
find_package(OpenCV REQUIRED)
find_package(
catkin REQUIRED COMPONENTS
roscpp
sensor_msgs
geometry_msgs
move_base_msgs
cv_bridge
image_transport
)
## Declare a catkin package
catkin_package()
## Build target library
include_directories(
include
${catkin_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
)
## Add executables
add_executable(object_collection src/turtlebot.cpp src/obstacle_avoidance.cpp src/navigator.cpp)
add_executable(detector src/object_detection.cpp src/detector.cpp)
## Add target link libraries
target_link_libraries(object_collection ${catkin_LIBRARIES} ${OpenCV_LIBS})
target_link_libraries(detector ${catkin_LIBRARIES} ${OpenCV_LIBS})
## Enable catkin test and add files for the same
if(CATKIN_ENABLE_TESTING)
set(CMAKE_BUILD_TYPE Debug)
find_package(rostest REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 --coverage")
add_rostest_gtest(
test_project_x_robot
test/project_x_test.launch
test/main.cpp
test/obstacle_avoidance_test.cpp
test/turtlebot_test.cpp
test/object_detection_test.cpp
src/obstacle_avoidance.cpp
src/turtlebot.cpp
src/object_detection.cpp)
target_link_libraries(
test_project_x_robot
${catkin_LIBRARIES}
${OpenCV_LIBS})
add_dependencies(
test_project_x_robot
object_collection
detector
${catkin_EXPORTED_TARGETS})
endif()