-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
45 lines (36 loc) · 973 Bytes
/
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
cmake_minimum_required (VERSION 2.8)
project (ros_unit_tests_example)
# Use C++14 : cmake >= 3.1
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(catkin REQUIRED COMPONENTS
roscpp
std_msgs
)
###################################
## catkin specific configuration ##
###################################
catkin_package(
CATKIN_DEPENDS
std_msgs
)
##############
# Executables
##############
include_directories(
include
${catkin_INCLUDE_DIRS}
)
# An example of a ROS node.
add_executable (my_main_node src/my_node.cpp)
target_link_libraries(my_main_node ${catkin_LIBRARIES})
##############
# Unit Tests
##############
if(CATKIN_ENABLE_TESTING)
message("\n\nGoing to build the tests!\n\n")
find_package(rostest REQUIRED)
add_rostest_gtest(my_unit_test launch/node_launcher.launch test/MyClass_test.cpp)
# catkin_add_gtest(my_unit_test test/MyClass_test.cpp)
target_link_libraries(my_unit_test ${catkin_LIBRARIES})
endif()