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

InstallBasicPackageFiles: Fix bug of OVERRIDE_MODULE_PATH that corrupt CMAKE_MODULE_PATH values set by blf transitive dependencies and fix OVERRIDE_MODULE_PATH with CMake 3.29.1 #79

Merged
merged 4 commits into from
Apr 9, 2024

Conversation

traversaro
Copy link
Collaborator

@traversaro traversaro commented Apr 9, 2024

Port of ami-iit/bipedal-locomotion-framework#827 to matio-cpp , and add an additional fix to ensure that the OVERRIDE_MODULE_PATH option of InstallBasicPackageFiles is compatible with CMake 3.29.1, see 20ed968 for more details.

…t CMAKE_MODULE_PATH values set by blf transitive dependencies
@traversaro traversaro requested a review from S-Dafarra as a code owner April 9, 2024 08:22
@traversaro traversaro mentioned this pull request Apr 9, 2024
…ke >=3.29.1

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 .

See #78 (comment) 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 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.
@traversaro traversaro changed the title InstallBasicPackageFiles: Fix bug of OVERRIDE_MODULE_PATH that corrupt CMAKE_MODULE_PATH values set by blf transitive dependencies InstallBasicPackageFiles: Fix bug of OVERRIDE_MODULE_PATH that corrupt CMAKE_MODULE_PATH values set by blf transitive dependencies and fix OVERRIDE_MODULE_PATH with CMake 3.29.1 Apr 9, 2024
@traversaro
Copy link
Collaborator Author

@S-Dafarra is busy with a demo, as this is useful to fix some CI, and I think @S-Dafarra trust my CMake skills, I will go on and release this. We can always do new releases to address eventual @S-Dafarra if necessary.

@traversaro traversaro merged commit a6cfddf into master Apr 9, 2024
10 checks passed
@S-Dafarra
Copy link
Member

@S-Dafarra is busy with a demo, as this is useful to fix some CI, and I think @S-Dafarra trust my CMake skills, I will go on and release this. We can always do new releases to address eventual @S-Dafarra if necessary.

Thanks a lot @traversaro ! Feel free to proceed as you deem necessary

@traversaro
Copy link
Collaborator Author

Interestingly, in the end CMake reverted their change: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9420 . Anyhow, the change we did made the code more robust to change of this kind, so it is useful anyhow (and it makes the code work with CMake 3.29.1).

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