Skip to content

CMakePackageConfigHelpers: Use unique variable name for pkg prefix

The PACKAGE_PREFIX_DIR variable name used previously did not account for nested dependencies of a package config file also using configure_package_config_file(). That meant a nested dependency could change the variable's value, so code in the package after pulling in a dependency could see a different value to what it expected. We now use the package name and a global counter to minimise the chance of any sort of name clash in consuming projects.

Fixes: #25827 (closed)
Backport: release

Edited by Craig Scott

Merge request reports