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

Colcon build failed if a package set the requirement of ament_index_cpp #86

Closed
tomcattiger1230 opened this issue Aug 5, 2022 · 7 comments

Comments

@tomcattiger1230
Copy link

-- Found ament_index_cpp: 1.4.0 (/Users/xxx/Develop/ros2/ros2_humble/install/share/ament_index_cpp/cmake)
CMake Error at /Users/xxx/Develop/ros2/ros2_humble/install/share/ament_index_cpp/cmake/ament_cmake_export_targets-extras.cmake:18 (message):
Failed to find exported target names in
'/Users/xxx/Develop/ros2/ros2_humble/install/share/ament_index_cpp/cmake/export_ament_index_cppExport.cmake'
Call Stack (most recent call first):
/Users/xxx/Develop/ros2/ros2_humble/install/share/ament_index_cpp/cmake/ament_index_cppConfig.cmake:41 (include)
CMakeLists.txt:14 (find_package)

@ooeygui
Copy link

ooeygui commented Aug 5, 2022

(Microsoft) I'm working on this. I'm staging a fix in https://github.com/ms-iot/ament_index/tree/humble, and will PR when I can verify it. This repros when compiling resource_retriever.

@tomcattiger1230
Copy link
Author

@ooeygui Thanks for this information. Correct. I've got the first error with resource_retriever. I've tried to skip this package, then I've noticed that almost every package with ament_index_cpp got the same error.

@ooeygui
Copy link

ooeygui commented Aug 6, 2022

@tomcattiger1230 Thanks for confirming. I'm root causing it.

@ooeygui
Copy link

ooeygui commented Aug 9, 2022

The CMake which ships with Visual Studio is later. Cmake recently changed _expectedTarget to _cmake_expected_target.

In C:\opt\ros\humble\x64\share\ament_index_cpp\cmake\ament_cmake_export_targets-extras.cmake
There's a block of code which looks for foreach and _expectedTarget:

    # extract the target names associated with the export
    set(_regex "foreach\\(_expectedTarget (.+)\\)")

However, the cmake files themselves reference _cmake_expected_target:

foreach(_cmake_expected_target IN ITEMS ament_index_cpp::ament_index_cpp)
  list(APPEND _cmake_expected_targets "${_cmake_expected_target}")
  if(TARGET "${_cmake_expected_target}")
    list(APPEND _cmake_targets_defined "${_cmake_expected_target}")
  else()
    list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}")
  endif()
endforeach()

And here's the change:
Kitware/CMake@59cc920

@tomcattiger1230
Copy link
Author

is there any suggestion to correct this? Thanks.

@ooeygui
Copy link

ooeygui commented Aug 10, 2022

There is a fix in progress - ament/ament_cmake#395

@clalancette
Copy link
Contributor

Actually, I'm going to close this one anyway since this is a duplicate of ament/ament_cmake#396

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants