Add osrm_ prefix to custom targets and ALIAS targets for FetchContent compatibility#7329
Add osrm_ prefix to custom targets and ALIAS targets for FetchContent compatibility#7329afarber wants to merge 8 commits intoProject-OSRM:masterfrom
Conversation
5007fb5 to
1bcdf2a
Compare
|
Not sure how much I favor universally changing the standard target names. Doing it conditionally on include could be ok. |
There was a problem hiding this comment.
Pull request overview
This PR improves CMake integration by prefixing custom targets with osrm_ and adding ALIAS targets with osrm:: namespace, preventing naming collisions when OSRM is included via FetchContent or add_subdirectory().
Changes:
- Renamed 5 custom targets (uninstall, doc, tests, benchmarks, copy_artifacts) with
osrm_prefix - Added 7 ALIAS targets (osrm::osrm, osrm::contract, osrm::extract, osrm::partition, osrm::customize, osrm::update, osrm::store)
- Updated documentation and CI workflows to use new target names
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| CMakeLists.txt | Added ALIAS targets and renamed uninstall and doc custom targets |
| unit_tests/CMakeLists.txt | Renamed tests to osrm_tests |
| src/nodejs/CMakeLists.txt | Renamed copy_artifacts to osrm_copy_artifacts |
| src/benchmarks/CMakeLists.txt | Renamed benchmarks to osrm_benchmarks |
| docs/testing.md | Updated documentation to reference osrm_tests |
| CHANGELOG.md | Added entry documenting the changes |
| .github/workflows/osrm-backend.yml | Updated CI workflow to use new target names |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
244b95e to
ccccf29
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ff9df0d to
a61e067
Compare
a61e067 to
de0c0e5
Compare
ee22658 to
d51e744
Compare
d51e744 to
9b85571
Compare
Issue
Fixes #7267
When OSRM is included via CMake's
FetchContentoradd_subdirectory(), generic target names likeuninstall,doc,testscollide with parent project targets. This PR:osrm_prefix when built as a subprojectosrm::ALIAS targets for all public librariesConditionally renamed targets
When built as subproject (via FetchContent/add_subdirectory), these targets use prefixed names to avoid collisions:
uninstallosrm_uninstalldocosrm_doctestsosrm_testsbenchmarksosrm_benchmarkscopy_artifactsosrm_copy_artifactsNew ALIAS targets
osrm::osrmosrm::contractosrm::extractosrm::partitionosrm::customizeosrm::updateosrm::storeTasklist
Requirements / Relations
None