Fix the libdir inside the installed CMake import files#6984
Fix the libdir inside the installed CMake import files#6984waruqi merged 1 commit intoxmake-io:devfrom
Conversation
…e libdir where the import files are installed.
Summary of ChangesHello @MeanSquaredError, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical issue where CMake import files failed to correctly locate installed libraries when a custom library directory was specified. By introducing a dynamic Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly addresses an issue where the library directory was hardcoded in generated CMake import files. By introducing a LIBDIR variable in the templates and substituting it in the generator script, the changes allow for customizable library installation paths like lib64. The implementation is sound and the changes are consistent across the modified files. I have one minor suggestion regarding code duplication to improve maintainability.
This PR fixes the library directory inside the generated CMake import files.
Currently it is possible to customize the install location of a target library by calling
where
libdiris the custom library directoryAlso it is possible to customize the location of the CMake import files for that target by calling
where
libdiris the custom library directory of the import files. However the import files have the library location hardcoded aslib.This means that it is possible to install the library and the CMake import files into a custom directory (e.g.
lib64, but the import files will always assume that the custom library is inlib. This in turn means that any attempts to find the installed library from CMake will fail.This PR fixes that issue by changing the import file templates so that they don't hardcode the
libdirectory but instead use the variableLIBDIR. Then the import files generator script is modified to substitute the correct value for theLIBDIRvariable when processing the templates.