[Development] Qt's cmake Config.cmake and ConfigVersion.cmake files

Stephen Kelly stephen.kelly at kdab.com
Tue May 14 14:37:23 CEST 2013


On Monday, May 13, 2013 21:19:27 Alexander Neundorf wrote:
> Hi,
> 
> I had a closer look at the installed cmake files.
> 
> The ConfigVersion.cmake files only check the version number. This is in many
> cases good enough.
> Additionally they should check that the 32/64bit-ness of the installed libs
> and the searching project is the same, so that for a 64bit project only
> 64bit libraries are accepted.

Yes, qmake will need to learn the bitness. That will happen here hopefully:

 https://codereview.qt-project.org/#change,56049

> 
> For the Config.cmake files:
> 
> * they don't contain any "API" documentation. I would expect documentation
> about the variables, macros etc. to be present at the top of each
> Config.cmake file.

The only API is documented at

 http://doc-snapshot.qt-project.org/5.0/qtdoc/cmake-manual.html

Anything else in the config files is implementation detail. As the config 
files are generated, generating 'API docs' with anything more than a link to 
the above url would be tricky and not necessary imo.

> 
> * there are no checks that the stuff the Config.cmake reports is actually
> present on disk. So the Config.cmake file could report success and state
> that the include dir is some directory, but there is no guarantee that this
> directory actually exists.

Good idea. I started implementing that here:

 https://codereview.qt-project.org/#change,56075

And found a bug already:

 https://codereview.qt-project.org/#change,56074

> 
> * they fail with FATAL_ERROR if the cmake version is less than 2.8.3
> In general, a find_package() must only fail if it was called with the
> REQUIRED keyword, or, I would argue, if a broken system state was detected
> (like something which the Config.cmake states is present on disk, is
> actually not present on disk, since this means something in the
> installation of the system is messed up).

Yes. I think the fatal error is fine anyway tbh. There's also a fatal error if 
FindQt4.cmake can only find Qt 5.

Thanks,

-- 
Stephen Kelly <stephen.kelly 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 --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3636 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130514/b9465008/attachment.bin>


More information about the Development mailing list