-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
export find_ros1_package cmake #164
Conversation
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
fa1d4d1
to
2c5ff62
Compare
You can test it with the referenced |
in order to compile these packages, the |
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
In order to use the cmake macros, the |
|
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
cmake/find_ros1_package.cmake
Outdated
# call ament_package() to avoid ament_tools treating this | ||
# as a plain CMake pkg | ||
ament_package() | ||
return() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This CMake extra file can't call ament_package()
. Instead the find_package(PkgConfig)
call should be REQUIRED
.
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
CMakeLists.txt
Outdated
@@ -69,7 +71,9 @@ ament_export_libraries(${PROJECT_NAME}) | |||
|
|||
ament_python_install_package(${PROJECT_NAME}) | |||
|
|||
ament_package() | |||
ament_package( | |||
CONFIG_EXTRAS cmake/find_ros1_package.cmake cmake/find_ros1_interface_packages.cmake |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: maybe move the duplicated arguments into a variable?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
CMakeLists.txt
Outdated
@@ -18,6 +18,7 @@ find_package(rmw_implementation_cmake REQUIRED) | |||
find_package(std_msgs REQUIRED) | |||
|
|||
# find ROS 1 packages | |||
list(APPEND ros1_cmake_macros cmake/find_ros1_package.cmake cmake/find_ros1_interface_packages.cmake) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the variable ros1_cmake_macros
doesn't exist yet use set()
instead. Based on the usage I would also suggest to name the variable cmake_extra_files
.
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
* export find_ros1_package cmake Signed-off-by: Karsten Knese <karsten@openrobotics.org> * export pkg-config dependency Signed-off-by: Karsten Knese <karsten@openrobotics.org> * use buildtool_export_depend Signed-off-by: Karsten Knese <karsten@openrobotics.org> * make pkg-config required Signed-off-by: Karsten Knese <karsten@openrobotics.org> * also export cmake macros if ros1 is not found Signed-off-by: Karsten Knese <karsten@openrobotics.org> * set cmake files in variable Signed-off-by: Karsten Knese <karsten@openrobotics.org> * use set instead of list Signed-off-by: Karsten Knese <karsten@openrobotics.org>
* export find_ros1_package cmake Signed-off-by: Karsten Knese <karsten@openrobotics.org> * export pkg-config dependency Signed-off-by: Karsten Knese <karsten@openrobotics.org> * use buildtool_export_depend Signed-off-by: Karsten Knese <karsten@openrobotics.org> * make pkg-config required Signed-off-by: Karsten Knese <karsten@openrobotics.org> * also export cmake macros if ros1 is not found Signed-off-by: Karsten Knese <karsten@openrobotics.org> * set cmake files in variable Signed-off-by: Karsten Knese <karsten@openrobotics.org> * use set instead of list Signed-off-by: Karsten Knese <karsten@openrobotics.org>
* export find_ros1_package cmake Signed-off-by: Karsten Knese <karsten@openrobotics.org> * export pkg-config dependency Signed-off-by: Karsten Knese <karsten@openrobotics.org> * use buildtool_export_depend Signed-off-by: Karsten Knese <karsten@openrobotics.org> * make pkg-config required Signed-off-by: Karsten Knese <karsten@openrobotics.org> * also export cmake macros if ros1 is not found Signed-off-by: Karsten Knese <karsten@openrobotics.org> * set cmake files in variable Signed-off-by: Karsten Knese <karsten@openrobotics.org> * use set instead of list Signed-off-by: Karsten Knese <karsten@openrobotics.org> Signed-off-by: Dhananjay Sathe <dhananjay.sathe@rapyuta-robotics.com>
Signed-off-by: Karsten Knese karsten@openrobotics.org
I believe this is the correct fix for exporting the
find_ros1_package.cmake. This allows other packages to use this macro straight after finding the
ros1_bridge` package.see: ros2/rosbag2#90 (comment)
please advise how to test this patch. Also I would appreciate if this could be backported to crystal.