Skip to content

Set CMake policy CMP0144 to new to use <PACKAGENAME>_ROOT env vars#630

Merged
bartlettroscoe merged 1 commit intoTriBITSPub:masterfrom
bartlettroscoe:cmake-4.0.0-2
Mar 22, 2025
Merged

Set CMake policy CMP0144 to new to use <PACKAGENAME>_ROOT env vars#630
bartlettroscoe merged 1 commit intoTriBITSPub:masterfrom
bartlettroscoe:cmake-4.0.0-2

Conversation

@bartlettroscoe
Copy link
Copy Markdown
Member

This eliminates warnings like:

CMake Warning (dev) at cmake/tribits/core/package_arch/TribitsProjectImpl.cmake:80 (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.

  Environment variable GIT_ROOT is set to:

    /projects/sems/install/rhel8-x86_64/sems/utility/git/2.37.0/gcc/8.3.0/base/vmjqb3w

  For compatibility, find_package is ignoring the variable, but code in a
  .cmake module might still use it.
Call Stack (most recent call first):
  cmake/tribits/core/package_arch/TribitsProject.cmake:62 (tribits_project_impl)
  CMakeLists.txt:53 (TRIBITS_PROJECT)
This warning is for project developers.  Use -Wno-dev to suppress it.

This is part of:

rabartlett1972
rabartlett1972 previously approved these changes Mar 22, 2025
Copy link
Copy Markdown
Collaborator

@rabartlett1972 rabartlett1972 left a comment

Choose a reason for hiding this comment

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

I tested this locally and it made the warning go away.

See the CHANGELOG.md entry.

I also added a new helper macro tribits_set_cmake_policy_if_exists() to make
setting policies for different versions of CMake more robustly.

Signed-off-by: Roscoe A. Bartlett <rabartl@sandia.gov>
Copy link
Copy Markdown
Collaborator

@rabartlett1972 rabartlett1972 left a comment

Choose a reason for hiding this comment

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

I tested this locally and it make that warning go away for Trilinos configure.

@bartlettroscoe bartlettroscoe merged commit 2e8a275 into TriBITSPub:master Mar 22, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants