[Development] Installing Qt5Config.cmake from the Qt repo?

lars.knoll at nokia.com lars.knoll at nokia.com
Fri Oct 28 21:14:02 CEST 2011



On 10/28/11 5:11 PM, "ext Stephen Kelly" <stephen.kelly at kdab.com> wrote:

>On Friday, October 28, 2011 16:24:08 Matt Williams wrote:
>> On 28 October 2011 14:44,  <lars.knoll at nokia.com> wrote:
>> >
>> > I think that's reasonable in general. It's similar to what we do to
>> > support pkgconfig. I agree with Thiago's comment that this should be
>> > split and we should have one file per shared library.
>> 
>> I think Stephen's suggestion of having one CMake file for all Qt
>> Essentials using find_package(Qt5 COMPONENTS QtGui etc...) makes the
>> most sense, at least for specifying which QtEssential libraries to
>> build against. It is the way most CMake files like this are done and
>> is not dissimilar to how the existing FindQt4.cmake works. Whether we
>> have a separate CMake file for Qt Addons (whether a separate one for
>> each module of another combined one) becomes a separate issue.
> 
>Yes, that should certainly work. The idea of one config file per library
>should also work:
> 
>find_package(Qt5Core)
>find_package(Qt5Gui)
>find_package(Qt5Widgets)
> 
>then the contents of Qt5Config would look something like (CMake code):
> 
>foreach(_component Qt5_FIND_COMPONENTS)
>  if (_component MATCHES QtCore)
>    find_package(Qt5Core NOMODULE)
>  endif()
>  # ... etc
>endforeach()
> 
>Regarding what Qt5Config should be able to find, I would say that it
>should be able to find QtWidgets, which is not an essential module, but
>an addon in Qt 5.
> 
>I'll prototype it next week and see how it goes.

My request here is that we don't add anything to qtbase that references
stuff on top (e.g. xmlpatterns). Modules should stay (wellÅ  rather:
become) fully self contained.

I also think that in this case each module should on installation provide
the file required to support cmake as a build system. Ie. qtxmlpatterns
should install one file somewhere that then magically makes
find_package(Qt5XmlPatterns) work.

Cheers,
Lars


> 
>> 
>> > How is this dependency wise? Would we need to install these files
>>into a
>> > special location and how do we know where this location is? Does
>> > supporting the feature require cmake to be installed?
>> 
>> From 
>>http://www.cmake.org/cmake/help/cmake2.6docs.html#command:find_package
>> (page down a little) you have a number of options of where to install
>> them. For example <prefix>/(share|lib)/<name>*/(cmake|CMake)/ where
>> <prefix> could be /usr and <name> could be 'Qt5' so they could be
>> installed in /usr/share/Qt5/cmake. There's similar special paths on
>> Windows and Mac.
>> 
>> For the purpose of building and installing Qt we have no dependence on
>> CMake. As Stephen says the files could just be created from some
>> templates using a bit of Perl (or whatever you want). For someone
>> building a project which depends on Qt they would of course need CMake
>> to find these files.
> 
>Yep, I have nothing more to add to this.
> 
>Thanks,
> 
>-- 
>Stephen Kelly <stephen at kdab.com> | Software Engineer
>KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
>www.kdab.com || Germany +49-30-521325470 || Sweden (HQ) +46-563-540090
>KDAB - Qt Experts - Platform-Independent Software Solutions
>_______________________________________________ Development mailing list
>Development at qt-project.org
>http://lists.qt-project.org/mailman/listinfo/development




More information about the Development mailing list