ament / ament_cmake

Supporting CMake packages for working with ament
Apache License 2.0
93 stars 119 forks source link

Cmake extras file installed by ament_cmake_export_dependencies may fail when rebuilding the workspace with a different build type #262

Open ivanpauno opened 3 years ago

ivanpauno commented 3 years ago

The problem is in the line here:

https://github.com/ament/ament_cmake/blob/9500695b67d2deed539374a844718da22e1cfa95/ament_cmake_export_dependencies/cmake/ament_cmake_export_dependencies-extras.cmake.in#L39

When rebuilding with a different build type _imported_configurations will be a list (e.g. NOCONFIG;RELEASE), and that makes the get_target_property call fail.

To reproduce:

colcon build --symlink-install --packages-up-to rosidl_typesupport_introspection_cpp
colcon build --symlink-install --packages-up-to rosidl_typesupport_introspection_cpp --cmake-args -DCMAKE_BUILD_TYPE=Release
kenji-miyake commented 3 years ago

Hello, I have the same problem with foxy. I've tested in my environment that just cherry-picking #290 on origin/foxy can resolves this. Is it possible to backport #290 to foxy? Thank you.

ivanpauno commented 3 years ago

Hello, I have the same problem with foxy. I've tested in my environment that just cherry-picking #290 on origin/foxy can resolves this. Is it possible to backport #290 to foxy? Thank you.

I didn't know this issue was fixed by #290, I will double check locally. Backporting #290 sounds fine to me, you would also will have to backport it togetehr with https://github.com/ament/ament_cmake/pull/296.

kenji-miyake commented 3 years ago

Although I've used https://github.com/kenji-miyake/ament_cmake/tree/foxy for a while, it seems there was no problem. That includes #290 and #296 as @ivanpauno suggested.

$ git log --oneline
555be3e (HEAD -> foxy, origin/foxy) fix cmake list(TRANSFORM ) is only available from version 3.12, (#296)
e8f6bb3 fix imported targets with multiple configuration (#290)
a56c3be (tag: 0.9.8) 0.9.8

@ivanpauno Could you backport this, please? Or can I send a PR?

ivanpauno commented 3 years ago

Or can I send a PR?

Sounds good to me, @hidmic does that sound good to you?

hidmic commented 3 years ago

Sounds reasonable to me! We can close this issue then?