summaryrefslogtreecommitdiffstats
path: root/kde.py
diff options
context:
space:
mode:
Diffstat (limited to 'kde.py')
-rw-r--r--kde.py48
1 files changed, 34 insertions, 14 deletions
diff --git a/kde.py b/kde.py
index 76d728c..69f0766 100644
--- a/kde.py
+++ b/kde.py
@@ -37,6 +37,7 @@ def detect_kde(env):
kdeincludes = env['ARGS'].get('kdeincludes', None)
kdelibs = env['ARGS'].get('kdelibs', None)
qtincludes = env['ARGS'].get('qtincludes', None)
+ tqtincludes = env['ARGS'].get('tqtincludes', None)
qtlibs = env['ARGS'].get('qtlibs', None)
kdedir = env['ARGS'].get('kdedir', None)
@@ -49,10 +50,10 @@ def detect_kde(env):
if kdedir: str="which %s 2>/dev/null" % (kdedir+'/bin/kde-config')
kde_config = os.popen(str).read().strip()
if len(kde_config):
- print GREEN + 'kde-config was found as ' + kde_config
+ print GREEN + 'kde-config was found as ' + kde_config + NORMAL
else:
- if kdedir: print RED + 'kde-config was NOT found in the folder given ' + kdedir
- else: print RED + 'kde-config was NOT found in your PATH'
+ if kdedir: print RED + 'kde-config was NOT found in the folder given ' + kdedir + NORMAL
+ else: print RED + 'kde-config was NOT found in your PATH' + NORMAL
print "Make sure kde is installed properly"
print "(missing package kdebase-devel?)"
env.Exit(1)
@@ -139,24 +140,42 @@ def detect_kde(env):
env.Exit(1)
env['QT_MOC'] = moc
- ## check for the qt and kde includes
- print "Checking for the qt includes : ",
- if qtincludes and os.path.isfile(qtincludes + "/tqlayout.h"):
+ ## check for the tqt includes
+ print "Checking for the tqt includes : ",
+ if tqtincludes and os.path.isfile(tqtincludes + "/tqlayout.h"):
# The user told where to look for and it looks valid
- print GREEN + "ok " + qtincludes + NORMAL
+ print GREEN + "ok " + tqtincludes + NORMAL
else:
- if os.path.isfile(qtdir + "/include/qlayout.h"):
+ if os.path.isfile(qtdir + "/include/tqlayout.h"):
# Automatic detection
print GREEN + "ok " + qtdir + "/include/ " + NORMAL
- qtincludes = qtdir + "/include/"
+ tqtincludes = qtdir + "/include/"
elif os.path.isfile("/usr/include/tqt/tqlayout.h"):
# Debian probably
print YELLOW + "the qt headers were found in /usr/include/tqt/ " + NORMAL
- qtincludes = "/usr/include/tqt"
+ tqtincludes = "/usr/include/tqt"
elif os.path.isfile("/usr/include/qt4/Qt/qglobal.h"):
# Debian probably
print YELLOW + "the qt headers were found in /usr/include/qt4/ " + NORMAL
- qtincludes = "/usr/include/qt4"
+ tqtincludes = "/usr/include/qt4"
+ else:
+ print RED + "the qt headers were not found" + NORMAL
+ env.Exit(1)
+
+ ## check for the qt includes
+ print "Checking for the qt includes : ",
+ if qtincludes and os.path.isfile(qtincludes + "/qglobal.h"):
+ # The user told where to look for and it looks valid
+ print GREEN + "ok " + qtincludes + NORMAL
+ else:
+ if os.path.isfile(qtdir + "/include/qglobal.h"):
+ # Automatic detection
+ print GREEN + "ok " + qtdir + "/include/ " + NORMAL
+ qtincludes = qtdir + "/include/"
+ elif os.path.isfile("/usr/include/qt3/qglobal.h"):
+ # Debian probably
+ print YELLOW + "the qt headers were found in /usr/include/qt3/ " + NORMAL
+ qtincludes = "/usr/include/qt3"
else:
print RED + "the qt headers were not found" + NORMAL
env.Exit(1)
@@ -227,6 +246,7 @@ def detect_kde(env):
## qt libs and includes
env['QTINCLUDEPATH']=qtincludes
+ env['TQTINCLUDEPATH']=tqtincludes
if not qtlibs:
qtlibs=qtdir+"/lib"
env['QTLIBPATH']=qtlibs
@@ -432,7 +452,7 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt
opts.Save(cachefile, env)
## set default variables, one can override them in sconscript files
- env.Append(CXXFLAGS = ['-I'+env['KDEINCLUDEPATH'], '-I'+env['QTINCLUDEPATH'] ])
+ env.Append(CXXFLAGS = ['-I'+env['KDEINCLUDEPATH'], '-I'+env['QTINCLUDEPATH'], '-I'+env['TQTINCLUDEPATH'], '-include', 'tqt.h' ])
env.Append(LIBPATH = [env['KDELIBPATH'], env['QTLIBPATH'] ])
env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
@@ -465,7 +485,7 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt
act.append('cat '+target[1].path+'.tmp >> '+target[1].path)
act.append('rm -f '+target[1].path+'.tmp')
act.append('echo \'#include "' + target[2].name + '"\' >> '+target[1].path)
- act.append('moc-tqt $QT_MOC -o '+target[2].path+' '+target[0].path)
+ act.append('moc-tqt $QT_MOC '+target[0].path+' '+target[2].path)
return act
def uicEmitter(target, source, env):
@@ -492,7 +512,7 @@ ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt
src_suffix = '.ui')
## moc file processing
- env['QT_MOCCOM'] = ('$QT_MOC -o ${TARGETS[0]} $SOURCE')
+ env['QT_MOCCOM'] = ('moc-tqt $QT_MOC $SOURCE ${TARGETS[0]}')
MOC_BUILDER = Builder(
action = '$QT_MOCCOM',