ros2 / message_filters

BSD 3-Clause "New" or "Revised" License
76 stars 66 forks source link

None of the ```.hpp``` files are copied into ```install/message_filters/include``` directory when package built from source. Fixed by adding one line in ```CmakeLIsts.txt``` file #155

Closed Mechazo11 closed 1 month ago

Mechazo11 commented 1 month ago

Specs: CPU: Ryzen 5600x OS: Ubuntu 22.04 ROS: ROS 2 Jazzy Jalisco (standalone workspace, built from source) Branch: jazzy initially, later switched to using rolling

Hello,

message_filters is a required dependency of the robot_localization package. When building from source, I have noticed that robot_localization was thrown an error stating it could not locate messages_filters/subscriber.hpp header file. I checked the /install/message_filters/include and found out only the .h files were copied. None of the .hpp files were copied.

To fix this issue, I modified the CmakeLists.txt file as shown below

install(
  DIRECTORY "include/"
  DESTINATION include/${PROJECT_NAME}
  FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp" # To fix why .hpp files are not copied when package is built
)

Adding the FILE_MATCHING_PATTERN ensures both .h and .hpp files are copied which then fixes the robot_localization packages build error.

clalancette commented 1 month ago

We are already coying the include directory, files should be there, maybe you need to rebuild again message_filters in your local workspace. This change I would say it's not required.

Yes, agreed.

By default, when building Rolling, you should get the .h files with the deprecation warnings, and the .hpp with the actual headers.

When you build Jazzy, Iron, or Humble (our other supported distributions), you should only get the .h files. We don't backport these kinds of changes to the stable distributions because we don't want to cause warnings there.

Thank you for the PR, but I'm going to close this. If you are still having trouble, please feel free to reopen and tell us exactly what you were trying to build, and the steps you took.

Mechazo11 commented 1 month ago

Hi @clalancette no problem. I have my fork up and will continue to keep an eye on this issue to see if this problem comes back again.