-
Notifications
You must be signed in to change notification settings - Fork 130
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
PRIVATE option to ament_target_dependencies does not work #481
Comments
Nowadays, Overall, we are (slowly) moving away from |
@clalancette would it make sense to add a warning to I think the average ROS developer probably doesn't understand the distinction between the various visibilities of linking in CMake and this is contributing to strange transitive dependency issues and build times across the ecosystem. This wouldn't be solved by pushing people to Adding a deprecation warning might be a good way to accelerate a community transition to more modern CMake with |
Unfortunately, not yet. There is one fairly major problem still remaining in using
Because the
And indeed, that is what we do in the core libraries. However, having all things that link to message packages have to do this kind of defeats the purpose of using only CMake targets everywhere. Once that bug is fixed, then yes, I would think we would want to do a deprecation warning.
Can you explain more about this? |
Yeah, I've been working on moving my codebase from foreach(package IN ITEMS ${ARGN})
if(TARGET ${package}::${package})
target_link_libraries(${target} ${visibility} ${package}::${package})
elseif(DEFINED ${package}_INCLUDE_DIRS OR DEFINED ${package}_LIBRARIES)
target_include_directories(${target} ${visibility}
${${package}_INCLUDE_DIRS})
target_link_libraries(${target} ${visibility} ${${package}_LIBRARIES})
else()
message(
FATAL_ERROR
"Package '${package}' doesn't provide modern CMake targets or legacy variables"
)
endif()
endforeach() that I'm using as an intermediary step between By "strange transitive dependency issues" I just mean you're a lot more likely to run into partially-specified dependency graphs if you're linking/including everything Build times, though, are very painful in both MoveIt Pro and Space ROS. |
#161 (comment)
I'd like to know why?
If only PUBLIC is allowed and it's used, I can only use public for all other dependencies, even for my PRIVATE library, which leads to a problem.
For example,
visualization_msgs
is my private library:but if I don't call
The user of my lib package will have this error:
The text was updated successfully, but these errors were encountered: