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

Emit a clear error when a component is not found in a required package #627

Merged

Conversation

gergondet
Copy link
Member

Prior to this PR a call to find_package(MyProject REQUIRED COMPONENTS MyComponent) would fail.

For example: (here find_package(baseline_walking_controller REQUIRED COMPONENTS FootstepPlanner))

-- baseline_walking_controller: FootstepPlanner not found.
-- C++ standard sufficient: Minimal required 11, currently defined: 14
CMake Error at CMakeLists.txt:5 (find_package):
  Found package configuration file:

    /usr/local/lib/cmake/baseline_walking_controller/baseline_walking_controllerConfig.cmake

  but it set baseline_walking_controller_FOUND to FALSE so package
  "baseline_walking_controller" is considered to be NOT FOUND.

The reason it fails is not easy to scan (here it is the top line but the real output there's many messages before that one)

With this PR we get the following error instead:

CMake Error at /usr/local/lib/cmake/baseline_walking_controller/baseline_walking_controllerConfig.cmake:180 (message):
  baseline_walking_controller: FootstepPlanner not found.
Call Stack (most recent call first):
  CMakeLists.txt:5 (find_package)

Copy link
Collaborator

@nim65s nim65s left a comment

Choose a reason for hiding this comment

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

nice, thanks !

@gergondet gergondet merged commit 9bd257d into jrl-umi3218:master Oct 18, 2023
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants