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

Stephen Kelly stephen.kelly at kdab.com
Fri Oct 28 11:11:20 EDT 2011


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.

> 
> > 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20111028/56ba9374/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20111028/56ba9374/attachment.sig>


More information about the cmake-developers mailing list