-
Notifications
You must be signed in to change notification settings - Fork 986
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
CMakeDeps checks build profile + CMakeDeps check real targets #9206
CMakeDeps checks build profile + CMakeDeps check real targets #9206
Conversation
Just missing a test here that shows the expected behavior for components coming from a build module. I think it is important to have this covered by a test |
@danimtb Added test, please review. |
Hello, I'm commenting on:
This is indeed a step further to fix the "regression" from 1.36 for my Qt5 use case (cf. #9112 comment), but the explicit check for defined components won't work in this situation. e.g. if we have in our CMakeLists.cmake something like: find_package(Qt5 COMPONENTS Core LinguistTools REQUIRED) then the test in Conan's Qt5Config.cmake passes for
This is because the |
... following-up with a suggestion: would it be possible to make that explicit check optional? (the whole An invalid component name in a find_package(Qt5 COMPONENTS Core LinguistToolZ REQUIRED)
Something like: |
Hi @cboos.
(and remove the |
Edit: I have checked that |
I did hope it would be possible to do that at the level of my Qt5 Conan package itself, so that I can keep using simple consumers based on a conanfile.txt and But still, that would then apply to all the dependencies, not just to that Qt5 one, and it's possibly the only one which wouldn't need the components check. So I see that more as a "property" of that package itself rather than a constraint to spread on its consumers, possibly affecting other packages. |
After checking that CMake is not failing by default when a component specified in the |
I just checked 468b68e and with that, I can use again my Qt5 package again! So thanks a lot! 👍 The point I raised above that it could be more appropriate to decide to check for components or not (so |
Changelog: Fix: Added warning in the new toolchains (the used in the generate() method) if no build profile is being used.
Changelog: Fix: Implemented check that will raise an error in the
CMakeDeps
generator when using thebuild_context_activated
,build_context_suffix
orbuild_context_build_modules
attributes if no build profile is being used.Changelog: Fix: The
CMakeDeps
generator will check if the targets specified in thefind_package(foo components x y z)
exist instead of checking against an internal variable. Also, this check will be done at the end of thexxx-config.cmake
so any includedbuild_module
can declare the needed targets.Docs: conan-io/docs#2173
For documentation: (Modify the documentation with a note indicating that the usage of build_context_activated, build_context_suffix and build_context_build_modules will fail if no build profile is specified. Also a note in every new generator that the usage of the build profile is very recommended or unexpected errors/behavior may ocurr)
Closes #9112