Add explicit rmf_traffic dependencies - #145
Conversation
3560058 to
2f5f0e1
Compare
| include(CMakeFindDependencyMacro) | ||
|
|
||
| find_dependency(rmf_task) | ||
| find_package(rmf_traffic REQUIRED) |
There was a problem hiding this comment.
I'm not very familiar with this part of the code but it seems this is only to generate the header with the schema as a string, so we might not need to add any dependency?
There was a problem hiding this comment.
Thanks for pointing this out.
You are right that the schema header generation itself does not need rmf_traffic. My intention here was not to support the schema generation step, but to export the dependency required by the public C++ API of rmf_task_sequence.
rmf_task_sequence exposes rmf_traffic types in public headers, for example rmf_traffic::Time, rmf_traffic::Duration, and rmf_traffic::agv::Plan::Goal. So downstream packages that call find_package(rmf_task_sequence) may also need the rmf_traffic dependency to be discoverable.
That said, I also noticed I used find_package(rmf_traffic REQUIRED) in the config template, which should be find_dependency(rmf_traffic) to match the other exported dependencies. I will update that.
| target_link_libraries(rmf_task_sequence | ||
| PUBLIC | ||
| rmf_task::rmf_task | ||
| rmf_traffic::rmf_traffic |
There was a problem hiding this comment.
I noticed that rmf_task is missing this dependency in its library, should it be added there as well?
There was a problem hiding this comment.
Good point, yes, I agree. I think it should be added as well.
I will update the PR.
73f62c3 to
44735e6
Compare
Signed-off-by: Guanxiao Qi <944843236@qq.com>
44735e6 to
0ea0dc0
Compare
This PR adds explicit
rmf_trafficdependency declarations forrmf_taskandrmf_task_sequence.Both packages directly use
rmf_traffictypes in their public headers and implementation code. For example:rmf_taskincludesrmf_traffic/Time.hpp,rmf_traffic/Trajectory.hpp, andrmf_traffic/agv/Planner.hppin request/task planning headers.rmf_task_sequenceusesrmf_traffic::Time,rmf_traffic::Duration, andrmf_traffic::agv::Plan::Goalin its public task, activity, and event APIs.Currently these packages can receive
rmf_traffictransitively through other RMF dependencies, but the direct source usage is not fully reflected in package metadata.Changes:
<depend>rmf_traffic</depend>tormf_task/package.xml.<depend>rmf_traffic</depend>tormf_task_sequence/package.xml.find_package(rmf_traffic REQUIRED)tormf_task_sequence/CMakeLists.txt.rmf_task_sequenceagainstrmf_traffic::rmf_traffic.rmf_taskagainstrmf_traffic::rmf_traffic.find_dependency(rmf_traffic)tormf_task_sequence's exported CMake config.rmf_taskalready hadfind_package(rmf_traffic REQUIRED)andfind_dependency(rmf_traffic), so the change there only updatespackage.xmlto match the existing CMake dependency.