Qt4 shouldn't require X11, even on Unix

Thiago Macieira thiago at kde.org
Mon Jul 7 21:36:16 CEST 2008


Alexander Neundorf wrote:
>I just checked, a check for X11 is part of FindQt4.cmake since rev 1.1
> in cmake cvs, almost exactly 3 years old.
>Do you think it's worth changing this ?
>(adds a difference to the version from cmake and might break some builds
> which accidentially use the X11 vars defined by this FIND_PACKAGE(X11)
> )

This would be akin to a source-incompatible change in CMake, I understand. 
But this isn't beyond the gcc developers, though: with gcc 4.3, they've 
made their headers a lot more strict, meaning you cannot assume that 
#including a file will bring another along. (For example, #include 
<string> will not #include <string.h> anymore, so no memcpy will be 
defined)

But that requirement there makes using Qt require the X11 headers, which 
isn't always so. You're fully allowed to do development with Qt without 
X11 headers installed (provided you're not using static builds). You 
can't build Qt without them -- but once you have, you can remove them.

Of course, this means you can't pass -lX11 on the linking command-line 
when linking to QtGui... and qmake itself isn't generating the proper 
Makefiles yet.

This again goes back to what I've been saying: all applications must 
declare all of its direct dependencies. It uses X11? FIND_PACKAGE + 
TARGET_LINK_LIBRARIES and whatever else.

I posted this here because someone on IRC was having issues: after 
removing the Qt4 dependency, his X11 code no longer compiled (Xss macros 
not defined). He should've had the Find_Package, but he didn't.
-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kde-buildsystem/attachments/20080707/cde8f77a/attachment.pgp 


More information about the Kde-buildsystem mailing list