Skip to content
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

Improve CMakeLists.txt #4

Merged
merged 1 commit into from
Jun 13, 2023
Merged

Improve CMakeLists.txt #4

merged 1 commit into from
Jun 13, 2023

Conversation

peci1
Copy link
Contributor

@peci1 peci1 commented Jun 11, 2023

Here are a few suggestions to improve CMakeLists.txt of the project.

Copy link
Contributor Author

@peci1 peci1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added explanations for the suggested changes.

@@ -1,8 +1,6 @@
cmake_minimum_required(VERSION 3.7.2)
cmake_minimum_required(VERSION 3.10.2)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The oldest CMake supported by ROS 1 is 3.10.2

project(point_cloud2_filters)

add_compile_options(-std=c++17)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw no C++17 code.

CATKIN_DEPENDS roscpp pluginlib filters tf2_ros pcl_ros pcl_conversions sensor_msgs
#DEPENDS PCL
)
catkin_package()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not expected that any other package will link to the filter provided by this package. In such case, catkin_package() should be empty because all the information within it are just for downstream packages trying to link to this one.

)
add_dependencies(pass_through_filter_point_cloud2 ${catkin_EXPORTED_TARGETS} ${${PROJECT_NAME}_EXPORTED_TARGETS})
class_loader_hide_library_symbols(pass_through_filter_point_cloud2)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit harder to explain, see ros-perception/perception_pcl#9 . Basically, hiding the dynamic symbols helps interoperability of the plugin with other plugins. And it makes linking to the dynamic library impossible, which is however wanted.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is great, I have never seen it :D

@@ -69,10 +58,6 @@ install(TARGETS pass_through_filter_point_cloud2
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

# Install headers
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As it is not expected any other package would link to this one, installing the includes does not make sense. It would only tempt users to write the includes, but then they'd find out they have no way to link to this plugin.

@torydebra torydebra merged commit 1b98fb6 into ADVRHumanoids:master Jun 13, 2023
@torydebra
Copy link
Member

Thanks for the explanations, usually cmake has obscure commands for me. I just adapted this one copying from the robot body filter one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants