OVERRIDE_MODULE_PATH used the PACKAGE_PREFIX_DIR variable, that however was an internal undocumented detail of configure_package_config_file and that was changed in CMake 3.29.1 by https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9390 .
To fix the problem, we switch to add directly the OVERRIDE_MODULE_PATH logic in the generated cmake config template, so that there we can use the @PACKAGE_CMAKE_INSTALL_PREFIX@ variable, and rely on the configure_package_config_file to appropriately substitute @PACKAGE_CMAKE_INSTALL_PREFIX@ with the actual relocated install prefix. To do so, we also pass CMAKE_INSTALL_PREFIX to the PATH_VARS option of configure_package_config_file.
OVERRIDE_MODULE_PATH
used thePACKAGE_PREFIX_DIR
variable, that however was an internal undocumented detail of configure_package_config_file and that was changed in CMake 3.29.1 by https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9390 .See https://github.com/ami-iit/matio-cpp/issues/78#issuecomment-2044457554 for more context.
To fix the problem, we switch to add directly the
OVERRIDE_MODULE_PATH
logic in the generated cmake config template, so that there we can use the@PACKAGE_CMAKE_INSTALL_PREFIX@
variable, and rely on theconfigure_package_config_file
to appropriately substitute@PACKAGE_CMAKE_INSTALL_PREFIX@
with the actual relocated install prefix. To do so, we also passCMAKE_INSTALL_PREFIX
to thePATH_VARS
option ofconfigure_package_config_file
.See also https://github.com/ami-iit/matio-cpp/pull/79 . I also added a test to prevent regression related to this in CI, in the form of
cmake-package-check BipedalLocomotionFramework --targets BipedalLocomotion::Framework
thanks to https://github.com/ami-iit/cmake-package-check/pull/8 .