From 96f917d9c25467a5a68b5e27e66885a8497a371e Mon Sep 17 00:00:00 2001 From: Flurin Arner Date: Mon, 30 Oct 2017 16:32:06 +0100 Subject: [PATCH 1/2] Minor edit, regarding the "message_generation" dependency vs the "genmsg" dependency. --- .../catkin_ws/src/beginner_tutorials/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/create_package_modified/catkin_ws/src/beginner_tutorials/CMakeLists.txt b/create_package_modified/catkin_ws/src/beginner_tutorials/CMakeLists.txt index 3e6426d..83f1f48 100644 --- a/create_package_modified/catkin_ws/src/beginner_tutorials/CMakeLists.txt +++ b/create_package_modified/catkin_ws/src/beginner_tutorials/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.3) project(beginner_tutorials) ## Find catkin and any catkin packages -find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs genmsg) +find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs message_generation) ## Declare ROS messages and services add_message_files(DIRECTORY msg FILES Num.msg) @@ -15,4 +15,4 @@ generate_messages(DEPENDENCIES std_msgs) ## Declare a catkin package catkin_package() -# %EndTag(FULLTEXT)% \ No newline at end of file +# %EndTag(FULLTEXT)% From c49c130f4734fa7aa0c729a49f968ddd6ec35e6d Mon Sep 17 00:00:00 2001 From: Flurin Arner Date: Mon, 30 Oct 2017 18:34:00 +0100 Subject: [PATCH 2/2] Updated to represent changes for package.xml format 2. Since catkin_create_pkg uses Package.xml format 2, some of the mentioned codelines are already uncommented, and I changed the code to reflect this. --- .../catkin_ws/src/beginner_tutorials/CMakeLists.txt | 10 +++++++++- .../catkin_ws/src/beginner_tutorials/CMakeLists.txt | 12 +++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/create_package_modified/catkin_ws/src/beginner_tutorials/CMakeLists.txt b/create_package_modified/catkin_ws/src/beginner_tutorials/CMakeLists.txt index 83f1f48..f57c59d 100644 --- a/create_package_modified/catkin_ws/src/beginner_tutorials/CMakeLists.txt +++ b/create_package_modified/catkin_ws/src/beginner_tutorials/CMakeLists.txt @@ -13,6 +13,14 @@ add_service_files(DIRECTORY srv FILES AddTwoInts.srv) generate_messages(DEPENDENCIES std_msgs) ## Declare a catkin package -catkin_package() +catkin_package( + INCLUDE_DIRS include + LIBRARIES beginner_tutorials + CATKIN_DEPENDS message_runtime roscpp rospy std_msgs + DEPENDS system_lib +) + +## Specify additional locations of header files +include_directories(${catkin_INCLUDE_DIRS}) # %EndTag(FULLTEXT)% diff --git a/create_package_pubsub/catkin_ws/src/beginner_tutorials/CMakeLists.txt b/create_package_pubsub/catkin_ws/src/beginner_tutorials/CMakeLists.txt index 6f61633..97fdfb8 100644 --- a/create_package_pubsub/catkin_ws/src/beginner_tutorials/CMakeLists.txt +++ b/create_package_pubsub/catkin_ws/src/beginner_tutorials/CMakeLists.txt @@ -13,11 +13,17 @@ add_service_files(FILES AddTwoInts.srv) generate_messages(DEPENDENCIES std_msgs) ## Declare a catkin package -catkin_package() +catkin_package( + INCLUDE_DIRS include + LIBRARIES beginner_tutorials + CATKIN_DEPENDS message_runtime roscpp rospy std_msgs + DEPENDS system_lib +) -## Build talker and listener -include_directories(include ${catkin_INCLUDE_DIRS}) +## Specify additional locations of header files +include_directories(${catkin_INCLUDE_DIRS}) +## Build talker and listener add_executable(talker src/talker.cpp) target_link_libraries(talker ${catkin_LIBRARIES}) add_dependencies(talker beginner_tutorials_generate_messages_cpp)