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

[CMAKE] FLANN_ROOT is used with cmake versions >=3.27 but CMP0144 is set to old #6094

Open
wodtko opened this issue Jul 24, 2024 · 1 comment

Comments

@wodtko
Copy link

wodtko commented Jul 24, 2024

currently, the cmake policy CMP0144 is implicitly set to old, in this.

If I understand things correctly, prior to CMP0144 upper-case <PACKAGENAME>_ROOT variables have been ignored.
Now, using CMP0144 NEW, would actually use these variables.

However, in the current configuration, the variable FLANN_ROOT is set, but the policy is set to OLD which results in a cmake warning that I do not manage to suppress from outside PCL.
The warning states:

CMake Warning (dev) at /usr/lib/x86_64-linux-gnu/cmake/pcl/Modules/FindFLANN.cmake:45 (find_package):
  Policy CMP0144 is not set: find_package uses upper-case <PACKAGENAME>_ROOT
  variables.  Run "cmake --help-policy CMP0144" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  CMake variable FLANN_ROOT is set to:

    /usr

  For compatibility, find_package is ignoring the variable, but code in a
  .cmake module might still use it.
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/pcl/PCLConfig.cmake:261 (find_package)
  /usr/lib/x86_64-linux-gnu/cmake/pcl/PCLConfig.cmake:306 (find_flann)
  /usr/lib/x86_64-linux-gnu/cmake/pcl/PCLConfig.cmake:570 (find_external_library)
  [... calling find_package(PCL) in our own config ...]
This warning is for project developers.  Use -Wno-dev to suppress it.

I'm not entirely sure why the issue is raised in the first place since cmake states here that the <PACKAGENAME>_ROOT variables are only ignored IF the <PackageName> has lower-case variables.
But I cannot find a way of suppressing the variable due to the line referenced above, where all policies are explicitly set, no matter what was previously configured. Perhaps the CMP0144 policy can be set to NEW explicitly if the CMake version >=3.27.

@Ryanf55
Copy link

Ryanf55 commented Jul 28, 2024

This causes downstream warnings on stable versions of grid_map when compiling:
ANYbotics/grid_map#464

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

2 participants