-
Notifications
You must be signed in to change notification settings - Fork 991
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
Add property to change the CMake variable names generated with CMakeDeps #16231
Add property to change the CMake variable names generated with CMakeDeps #16231
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what we want is the possibility of having multiple variants of the variables, besides the canonical file_name
one, the current one. It should be a list that allows different casing/writing of the variable, not just one.
conans/test/integration/toolchains/cmake/cmakedeps/test_cmakedeps.py
Outdated
Show resolved
Hide resolved
conans/test/integration/toolchains/cmake/cmakedeps/test_cmakedeps.py
Outdated
Show resolved
Hide resolved
conans/test/integration/toolchains/cmake/cmakedeps/test_cmakedeps.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job
Just wanted to say thanks for adding this feature. The simple difference in capitalization of variable prefixes has been by far the most common reason for having to apply patches to public CMake projects on CCI. Also the most common reason for having to include custom CMake modules in the recipe. Two birds with one stone. Thanks! |
…eps (conan-io#16231) * add legacy variable prefix for cmakedeps * fix implementation * improve template variables * simplify code * improve test * add support for multiple cmake variable names and simplify test * improve code
* options patterns warning * Add property to change the CMake variable names generated with CMakeDeps (#16231) * add legacy variable prefix for cmakedeps * fix implementation * improve template variables * simplify code * improve test * add support for multiple cmake variable names and simplify test * improve code * Add GCC 13.3 (#16245) * review * fix test * wip --------- Co-authored-by: Juan <35701596+juansblanco@users.noreply.github.com> Co-authored-by: Rubén Rincón Blanco <rubenrb@jfrog.com>
Changelog: Feature: Add
cmake_additional_variables_prefixes
variable to CMakeDeps generator to allow adding extra names for declared CMake variables.Docs: conan-io/docs#3721
Created new property for CMakeDeps generator:
cmake_legacy_variable_prefix
that can be set inpackage_info()
of the conanfile.It allows changing the prefix used when creating CMake variables instead of the package name that was currently being used.
Closes: #14788
develop
branch, documenting this one.