Git Product home page Git Product logo

Comments (8)

mikaelarguedas avatar mikaelarguedas commented on August 20, 2024

this will be targeted post bouncy, removing the milestone.

from ament_cmake.

dirk-thomas avatar dirk-thomas commented on August 20, 2024

A CMake function with that functionality already exists: ament_include_directories_order

And it is already being used within ament_target_dependencies:

ament_include_directories_order(ordered_include_dirs ${include_dirs})

Since the referenced PR collects the include directories manually the package needs to call ament_include_directories_order manually.

@wjwwood Can this ticket be closed?

from ament_cmake.

dirk-thomas avatar dirk-thomas commented on August 20, 2024

Not relevant for the reported case of this ticket but after investigating another report I created #157 which fixes ament_include_directories_order on non-Windows platforms.

from ament_cmake.

wjwwood avatar wjwwood commented on August 20, 2024

I think it could be closed if the workaround in ros2/rviz#243 were replaced with use of this function.

I think we ought to be using it everywhere, but that's a systemic issue.

from ament_cmake.

dirk-thomas avatar dirk-thomas commented on August 20, 2024

I think it could be closed if the workaround in ros2/rviz#243 were replaced with use of this function.

Do you want to keep this ticket open until that has been addressed in the rviz repo? (If that isn't the case in the short term I would rather suggest creating a ticket in that repo instead.)

I think we ought to be using it everywhere, but that's a systemic issue.

Afaik we already do use ament_target_dependencies in numerous places. So I don't think it is a systemic issue. If there are any cases where we don't please point them out so we can change them.

from ament_cmake.

wjwwood avatar wjwwood commented on August 20, 2024

Well, my original ask for this issue was to keep it open until the necessary feature was added and deployed in rviz and elsewhere:

Also, this new function should either be used everywhere or at least where it has been a problem before, and in either case the pr linked above should be fixed with this function as well.

-- #130 (comment)


I was unaware of the function and also unaware of any place where we were using it. I didn't realize we were using it in ament_target_dependencies(), but does this work if you call it multiple times per target?

Also, searching for target_include_directories() results in 204 matches across 83 files. So discounting a few instances inside of pure cmake packages and within ament_cmake, all of those cases could introduce a problem (as they are added outside of ament_target_dependencies). include_directories is less common, but is used in our googletest integration and in some random packages like laser_geometry and qt_gui_core, so those might an issue too (as I understand it).

Is there an example of how (or do you have an idea of how) to use this correctly when you need to add the include directory manually and with ament_target_dependencies? Do we just make sure they come after (or maybe before) ament_target_dependencies to avoid the issue?

At the very least we should address it in rviz. Since you suggested the fix in rviz originally (and because it's still a bit unclear to me how to do it along side ament_target_dependencies), can you have a look at the follow up to use this method to avoid it?

from ament_cmake.

dirk-thomas avatar dirk-thomas commented on August 20, 2024

but does this work if you call it multiple times per target?

Each call is separate from each other. So only the dependencies from a single call are ordered relatively to each other. Separate calls are adding the information in the order of the calls.

Is there an example of how (or do you have an idea of how) to use this correctly when you need to add the include directory manually and with ament_target_dependencies?

I am not sure what kind of example you are looking for. If you need to call both functions they will add the information to the target in the order you call them. Just as if you would call target_include_directories twice in vanilla CMake.

can you have a look at the follow up to use this method to avoid it?

I am sorry, but I simply don't have the bandwidth to start looking into making rviz pull requests. The usage of the function should be really trivial: just call ament_target_dependencies for all dependencies which adhere to the CMake variable "standard" and call vanilla CMake function for everything else afterwards (assuming those will be system dependencies).

from ament_cmake.

dirk-thomas avatar dirk-thomas commented on August 20, 2024

my original ask for this issue was to keep it open until the necessary feature was added and deployed in rviz and elsewhere:

I created ros2/ros2#658 to track the enhancement to use ament_target_dependencies wherever possible / beneficial / necessary (just for a better scope of the items rather than having it hidden in this repo).

from ament_cmake.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.