Skip to content

Conversation

@sethrj
Copy link

@sethrj sethrj commented Jan 17, 2025

This is a follow-up to #51 and is related to some nasty obscure side effects of the policy alteration by the previous implementation, seen in celeritas-project/celeritas#1573.

It's unusual to use cmake_minimum_required in a package config file, since it can alter policy scope elsewhere (depending, of course, on the policy that's been set). The cmake_policy command correctly scopes the changes to the Config file, rather than applying the change to the rest of the user's code when called from inside find_package or find_dependency.

The updated usage mirrors the CMake-generated Targets.cmake file: assertions to check for the rough CMake version, then a scoped policy change for the file itself.

Policy correctly scopes the changes to the Config file, rather than
applying the change to the rest of the user's code when called from
inside `find_package` or `find_dependency`.
@sethrj sethrj closed this Jan 13, 2026
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