Skip to content
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

fix names of exported interfaces in @PROJECT_NAME@_INTERFACES #231

Merged
merged 2 commits into from
Mar 27, 2020

Conversation

dirk-thomas
Copy link
Contributor

Fixes #183.

Unfortunately I don't think there is a CMake API to get the target names for an export name. Therefore this patch parses the generated CMake export file. 😞

CI builds (without retrying flaky tests):

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
@dirk-thomas dirk-thomas added the bug Something isn't working label Mar 27, 2020
@dirk-thomas dirk-thomas self-assigned this Mar 27, 2020
@dirk-thomas
Copy link
Contributor Author

dirk-thomas commented Mar 27, 2020

E.g. trying to use the exported targets of ament_index_cpp (https://github.com/ament/ament_index/blob/3d918fd64a906e9fc4038889fc6d1d1d22ae06d8/ament_index_cpp/CMakeLists.txt#L37) doesn't work atm:

CMake Error at CMakeLists.txt:<lineno> (add_library):
  Target "<target-name> links to target
  "ament_index_cpp::export_ament_index_cpp" but the target was not found.
  Perhaps a find_package() call is missing for an IMPORTED target, or an
  ALIAS target is missing?

The previous logic used export name export_ament_index_cpp which is not a valid target name. With the patch the export name is mapped to the actual target names associated to that export name.

Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
@dirk-thomas dirk-thomas requested a review from hidmic March 27, 2020 21:49
Copy link
Contributor

@hidmic hidmic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once all CI jobs are green !

@dirk-thomas
Copy link
Contributor Author

... once all CI jobs are green !

Yellow will have to do... 😉

@dirk-thomas dirk-thomas merged commit f428b89 into master Mar 27, 2020
@delete-merged-branch delete-merged-branch bot deleted the dirk-thomas/fix-names-exported-interfaces branch March 27, 2020 22:16
@dirk-thomas
Copy link
Contributor Author

Related to ros2/ros2#904.

j-rivero pushed a commit that referenced this pull request Apr 27, 2020
* fix names of exported interfaces in @PROJECT_NAME@_INTERFACES

Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>

* use string(REGEX REPLACE ..)

Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ament_export_interfaces assumes export name and target name are the same
2 participants