Closed jonselling closed 1 year ago
I'll take a look at what's going on.
@jonselling when you said you removed any of the calls that use the ${PROJECT_NAME}
interface, what did you mean by that?
I commented out these lines in the CMakeLists.txt
add_library(${PROJECT_NAME} INTERFACE)
target_include_directories(${PROJECT_NAME} INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>"
)
install(TARGETS ${PROJECT_NAME}
EXPORT export_${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION lib
INCLUDES DESTINATION include
)
...
ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET)
And then I also commented out everything in the if (BUILD_TESTING AND ...)
statement
Description
When building against
swri_roscpp
in ROS2 humble, there is an error that thediagnostic_updater
is not exported correctly as a dependency (at least for finding the header file). I get this error unless I add the dependency to my own package:Environment
Branch: ros2-devel Distro: humble
Actual Results
I get a build error against a dependency my package does not use
Expected Results
That dependency should get passed as an export from swri_roscpp to my package.
Additional Info
I checked the CMakeLists.txt and it looks like the dependency should get exported, so I started to mess around with the file a little.
I was able to compile with removing any of the calls that use the
${PROJECT_NAME}
interface and then removing theBUILD_TESTING
block.I am unsure if it is because the ${PROJECT_NAME} export data gets written weirdly with the INTERFACE target and then the
rosidl_generate_interfaces
stuff might interfere in the testing part of the CMakeLists.txt.