ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Yes; you should be adding to the CMakeLists from the previous tutorial.
You shouldn't be trying to combine multiple statements from the different tutorials.
For example, each call to add_executable()
in cmake defines a new executable that you're trying to compile, and you want to compile each tutorial, so you should have two separate calls to add_executable()
Your final CMakeLists should look something like:
cmake_minimum_required(VERSION 2.8.3)
project(learning_actionlib)
find_package(catkin REQUIRED COMPONENTS roscpp actionlib actionlib_msgs)
find_package(Boost REQUIRED COMPONENTS system)
add_action_files(
DIRECTORY action
FILES Fibonacci.action
)
generate_messages(
DEPENDENCIES actionlib_msgs std_msgs
)
catkin_package(
CATKIN_DEPENDS actionlib_msgs
)
include_directories(include ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
add_executable(fibonacci_server src/fibonacci_server.cpp)
target_link_libraries(
fibonacci_server
${catkin_LIBRARIES}
)
add_dependencies(
fibonacci_server
${learning_actionlib_EXPORTED_TARGETS}
)
add_executable(fibonacci_client src/fibonacci_client.cpp)
target_link_libraries(
fibonacci_client
${catkin_LIBRARIES}
)
add_dependencies(
fibonacci_client
${learning_actionlib_EXPORTED_TARGETS}
)