# Qt (tm) module for the A-A-P build system. # # Written by Adriaan de Groot. Copyright is assigned to # Bram Moolenaar and Stichting NlNet Labs. Released under # the GPL, version 2. There should be a file named COPYING # in the main A-A-P directory with the complete text of # this license. QTDIR = `os.environ.get("QTDIR")` @if not QTDIR: @for dir in ['/usr/X11R6', '/usr', '/usr/local', '/usr/lib/qt3']: @if os.path.isdir(dir) and os.path.isfile(dir + "/include/qglobal.h"): QTDIR = `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. @if not os.path.isdir(QTDIR): :error Environment variable QTDIR ($QTDIR) does not specify the Qt directory. @if not os.path.isfile(QTDIR + "/include/qglobal.h"): :error Qt directory ($QTDIR) is missing include/qglobal.h moc = $QTDIR/bin/moc @if not os.path.isfile(moc): :error moc ($moc) is not executable. # Filetypes in Qt & KDE :filetype suffix ui ui # designer files suffix moc moc # moc files declare h # header files, just to be complete # This is for the intermediate mocs, which get #included :action h2moc default :sys $moc -o $-target $source :rule {global} {sourceexists} %.moc : %.h :do h2moc { target = `bdir(target)` } $source # Designer files # Two actions, because h files are often considered C or C++ sources. :action ui2h h ui :sys uic -tr i18n $source > `bdir(target,0)` :action ui2h cpp ui :sys uic -tr i18n $source > `bdir(target,0)` :action ui2cpp cpp ui :do ui2h { target = `bdir(sufreplace("",".h",source))` { filetype=h } } $source { filetype=ui } :sys echo "#include " > $target :sys uic -tr tr2i18n -impl `sufreplace("",".h",source)` $source > $(target).temp :sys sed -e "s,tr2i18n( \"\" ),QString::null,g" -e "s,tr2i18n( \"\"\, \"\" ),QString::null,g" -e "s,image\([0-9][0-9]*\)_data,img\1_dbSelection_base,g" $(target).temp >> $target :sys rm -rf $(target).temp :sys echo "#include \""`sufreplace("",".moc",source)`"\"" >> $target :route ui h ui2h :route ui cpp object,ltobject ui2cpp `sufreplace("",".cc",source)` compile :route ui h moc ui2h `sufreplace("",".h",source)` h2moc :rule {global} {sourceexists} %.cc : %.ui :do ui2cpp { target = $(target[0]) } $source :rule {global} {sourceexists} %.h { filetype=h } : %.ui :do ui2h { target = $(target[0]) } $source # vim: set sw=4 sts=4 tw=79 et :