Updating the Qt module

Adriaan de Groot <[email protected]> Sun, 4 Dec 2005 15:01:43 +0100
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
--nextPart1823674.ziS8OnVPci
Content-Type: multipart/mixed;
  boundary="Boundary-01=_IbvkDXOf06/13zt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

--Boundary-01=_IbvkDXOf06/13zt
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Attached find a patch that updates the Qt module to use the (new) bdir()=20
function and that looks in more sensible places to find Qt (as opposed to t=
he=20
old form of the module, which looked in my personal private very weird=20
location for Qt 3.2 only).

I promise to document this in the user manual once I finish sorting out the=
=20
KDE module which depends on Qt.

=2D-=20
These are your friends - Adem
    GPG: FEA2 A3FE Adriaan de Groot

--Boundary-01=_IbvkDXOf06/13zt
Content-Type: text/x-diff;
  charset="us-ascii";
  name="qt.aap.diff"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="qt.aap.diff"

Index: modules/qt.aap
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/a-a-p/Exec/modules/qt.aap,v
retrieving revision 1.4
diff -u -3 -p -r1.4 qt.aap
=2D-- modules/qt.aap	18 Oct 2003 15:05:59 -0000	1.4
+++ modules/qt.aap	4 Dec 2005 13:59:06 -0000
@@ -8,21 +8,24 @@
=20
 QTDIR =3D `os.environ.get("QTDIR")`
 @if not QTDIR:
=2D  QTDIR =3D /usr/local/qt-3.2
=2D  qtdir_source =3D "Default QTDIR"
+  @for dir in ['/usr/X11R6', '/usr', '/usr/local']:
+    @if os.path.isdir(dir) and os.path.isfile(dir + "/include/qglobal.h"):
+      QTDIR =3D `dir`
+  @if not QTDIR:
+    :error No QTDIR specified; Qt could not be found automatically.
+  # Patently impossible
+  @if not os.path.isdir(QTDIR):
+    :error Autodetected Qt directory ($QTDIR) is not a directory.
 @else:
=2D  qtdir_source =3D "Environment QTDIR"
=2D
=2D@if not os.path.isdir(QTDIR):
=2D  :error $qtdir_source ($QTDIR) is not a directory.
+  :error Environment variable QTDIR ($QTDIR) does not specify the Qt direc=
tory.
=20
+@if not os.path.isfile($QTDIR + "/include/qglobal.h"):
+  :error Qt directory ($QTDIR) is missing include/qglobal.h
=20
 moc =3D $QTDIR/bin/moc
 @if not os.path.isfile(moc):
   :error moc ($moc) is not executable.
=20
=2D# qt_includedir =3D $QTDIR/include
=2D
 # Filetypes in Qt & KDE
 :filetype
       suffix ui ui    # designer files
@@ -34,20 +37,19 @@ moc =3D $QTDIR/bin/moc
       :sys $moc -o $-target $source
=20
 :rule {global} {sourceexists} %.moc : %.h
=2D      :do h2moc $source
=2D
+      :do h2moc { target =3D `bdir(target)` } $source
=20
=20
 # Designer files
=20
 # Two actions, because h files are often considered C or C++ sources.
 :action ui2h h ui
=2D      :sys uic -tr i18n $source > $target
+      :sys uic -tr i18n $source > `bdir(target,0)`
 :action ui2h cpp ui
=2D      :sys uic -tr i18n $source > $target
+      :sys uic -tr i18n $source > `bdir(target,0)`
=20
 :action ui2cpp cpp ui
=2D      :do ui2h { target =3D $BDIR/`sufreplace("",".h",source)` { filetyp=
e=3Dh } }=20
+      :do ui2h { target =3D `bdir(sufreplace("",".h",source))` { filetype=
=3Dh } }
                $source { filetype=3Dui }
       :sys echo "#include <klocale.h>" > $target
       :sys uic -tr tr2i18n -impl `sufreplace("",".h",source)` $source > $(=
target).temp

--Boundary-01=_IbvkDXOf06/13zt--

--nextPart1823674.ziS8OnVPci
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (FreeBSD)

iD8DBQBDkvbNdqzuAf6io/4RAvblAJ0ZD4lQoaHqngMwbujRirfzWD11RACfeXGT
J60JX2Nhb6US6mCSYhhDdMk=
=CG/1
-----END PGP SIGNATURE-----

--nextPart1823674.ziS8OnVPci--


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click