Fix Eigen Plugins compilation when linking to grid_map_core#475
Fix Eigen Plugins compilation when linking to grid_map_core#475Ryanf55 wants to merge 3 commits intoANYbotics:rollingfrom
Conversation
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
| find_package(grid_map_cmake_helpers REQUIRED) | ||
|
|
||
| ## Define Eigen addons. | ||
| include(cmake/${PROJECT_NAME}-extras.cmake) |
There was a problem hiding this comment.
This needs to be moved down till after the library is created. You can't call target_compile_definitions on a target until the target exists.
| ) | ||
| ament_package() | ||
| #ament_package(CONFIG_EXTRAS | ||
| # cmake/${PROJECT_NAME}-extras.cmake |
There was a problem hiding this comment.
This breaks if we leave it in - any tips on how to test the plugins are working in another package?
|
Just adding my $0.02 that this PR does fix the Eigen linker issues when using grid_map_core for me, thank you! I can't speak to its potential impact on other plugins, though. |
Thanks for sharing! |
|
My $0.02: This is in line with what I proposed. I would only move the code from the extas file to the main cmakelists and remove the extras file. Generally, setting these Eigen compile time variables in the public interface of a library is IMHO bad style as it limits or at least makes it a lot more complicated for people to add their own extensions and makes it incompatible with any other library that does the same (of which I hope there are none but still). |
|
Thanks for this! I am not sure about the proper solution but this is what I have been end up using to be able to build and use properly |
THanks for the report. If you take this branch, and try it, does it fix the problem? I think we should merge this, no one said it made things worse. |
|
Hi @Ryanf55 , sorry for my late answer. My branch fixes the problem: botsandus@3ce1c30 Not the one from this PR |
|
Linking to my proposed fix #519. cmake extras should not be needed IMO. |
Purpose
Here's a proposed patch for #382. Because the original PR for adding the plugins through CMake and ament is not well documented, I really don't know how this will affect others. Please try this PR out. It will stay open for a while until I get a reasonable number of approvals it doesn't break anything.
Test instructions
colcon build --packages-up-to issue382And try building your own packages that link to grid_map_core.