Eliminating confusion after pkgconfig fails to find packages
David Jarvie
djarvie at kde.org
Tue Mar 10 00:01:18 CET 2009
Currently, FindXXXX.cmake scripts often use pkgconfig to attempt to find a
package, followed by other code which may locate it even if pkgconfig failed.
See for example FindQImageBlitz.cmake. The way these scripts are currently
coded produces misleading output when they are run, when pkgconfig fails to
find the package but it is nevertheless found by the subsequent code in the
script. In the QImageBlitz example, the console output is:
-- checking for module 'qimageblitz'
-- package 'qimageblitz' not found
even if the package is actually found after pkgconfig fails to find it. This
can lead to significant time wasting trying to work out what has gone wrong
when in fact nothing is wrong at all.
I propose a new function to replace the call to
find_package_handle_standard_args() in these scripts. This function would
always output a 'Found' message, thereby ensuring that the user is not left
under the impression that a package which actually exists on the system has
not been found by cmake. The messages in the example would then be:
-- checking for module 'qimageblitz'
-- package 'qimageblitz' not found
-- Found QImageBlitz: /opt/kde4.2/include/qimageblitz
The new function is attached. If agreed that this can be committed, I'll
prepare a patch to modify the relevant FindXXXX.cmake scripts to use it.
--
David Jarvie.
KAlarm author and maintainer.
http://www.astrojar.org.uk/kalarm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FindPkgConfigHandleStandardArgs.cmake
Type: text/x-cmake
Size: 1599 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-buildsystem/attachments/20090309/7617b9d1/attachment-0001.bin
More information about the Kde-buildsystem
mailing list