[CMake] find_package with COMPONENTS never honors REQUIRED

Eric Noulard eric.noulard at gmail.com
Thu Aug 30 14:32:17 EDT 2018


Le jeu. 30 août 2018 à 20:03, George PF <george.p.f at mail.com> a écrit :

> > The documentation is intriguing about REQUIRED COMPONENTS interaction....
>
> That's... one way to put it.
>

Yeah you know. Kind of ironic here :-)


> > So it is possible that the failure behavior when specifying COMPONENTS
> is up to the module...
>
> I admit I was not reading the docs in that depth, but REQUIRED can only
> mean one thing and should
> not need second guessing the documentation. Sadly, someone thought
> otherwise.
>

I guess there is no one to blame here.
The doc is too-realistic about the state of find modules.
At least Config mode should do it right I hope.
Module mode is historically for hand-written module maintained by
volunteers:
https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/dev/Module-Maintainers

> Do you see this only with Qt or do other packages with components (may be
> Boost) behave like this?
> > I guess that Qt5 should be running in config mode, whereas boost must be
> in module mode though.
>
> I was debugging an older cmake project and wondered why it was not finding
> the non-standard Qt location,
> that's when I stumbled upon this issue.
>

I see. I think something could/should be done for Config mode, for Module
mode It would certainly depends on the module maintainer.

-- 
Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180830/259b5520/attachment.html>


More information about the CMake mailing list