summaryrefslogtreecommitdiffstats
path: root/UI/Qt
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-06-01 10:52:35 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-06-01 10:53:37 (GMT)
commit456a04711c814b6302fcb57005bed873acb12c38 (patch)
treefca2e301f3bfe9f0de72a255dd800e3ef8903914 /UI/Qt
parent2812bddd81f8a1b804c7460f4e14cd0aa393d129 (diff)
downloadswift-456a04711c814b6302fcb57005bed873acb12c38.zip
swift-456a04711c814b6302fcb57005bed873acb12c38.tar.bz2
Updated qmakeish to new directory structure.
Diffstat (limited to 'UI/Qt')
-rw-r--r--UI/Qt/Swift.pro2
-rwxr-xr-xUI/Qt/qmakeish.py107
2 files changed, 108 insertions, 1 deletions
diff --git a/UI/Qt/Swift.pro b/UI/Qt/Swift.pro
index 1aec626..83bbb45 100644
--- a/UI/Qt/Swift.pro
+++ b/UI/Qt/Swift.pro
@@ -23,7 +23,7 @@ win32 {
LIBS += "F:/Expat 2.0.1/Bin/libexpat.lib"
LIBS += -LF:/OpenSSL/lib/VC -llibeay32MT -lssleay32MT
- include(../../Swiften/Swift.pri)
+ include(Swiften.pri)
LIBS += -ldnsapi -lws2_32 -lwsock32
} else {
DEPENDPATH += . ../.. ../../3rdParty/Boost
diff --git a/UI/Qt/qmakeish.py b/UI/Qt/qmakeish.py
new file mode 100755
index 0000000..1625bd0
--- /dev/null
+++ b/UI/Qt/qmakeish.py
@@ -0,0 +1,107 @@
+#!/usr/bin/env python
+# Run this from the UI/Qt dir with:
+# ./qmakeish.py ../../Makefile > Swiften.pri
+
+import sys, re, os.path
+
+def processSourcesLine(line) :
+ strippedLine = line.rstrip("\n")
+ sourceFile = re.sub("\\\\$", "", strippedLine).strip()
+ if len(sourceFile) > 0 :
+ print "SOURCES += $$PWD/../../" + sourceFile
+ return strippedLine.endswith("\\")
+
+def processFlags(name, flags) :
+ flags = flags.replace("-isystem ", "-I")
+ for flag in flags.split(" ") :
+ if flag.startswith("-D") :
+ print "DEFINES += " + flag[2:]
+ elif flag.startswith("-I") :
+ print "INCLUDEPATH += $$PWD/../../" + flag[2:]
+ elif len(flag) > 0 :
+ print name + " += " + flag
+
+
+assert(len(sys.argv) == 2)
+
+basedir = os.path.dirname(sys.argv[1])
+
+# Flatten the makefile
+makefile = []
+files = [open(sys.argv[1])]
+while len(files) > 0 :
+ file = files[-1]
+ line = file.readline()
+ if line :
+ match = re.match("include (.*)", line)
+ if match and match.group(1) != "Makefile.config" :
+ files.append(open(os.path.join(basedir, match.group(1))))
+ makefile.append("## Begin File: " + match.group(1))
+ else :
+ makefile.append(line)
+ else :
+ makefile.append("## End file")
+ file.close()
+ files.pop()
+
+# Process makefile
+inSources = False
+for line in makefile :
+ if inSources :
+ inSources = processSourcesLine(line)
+ else :
+ # Conditional
+ match = re.match("if(n?)eq \(\$\((.*)\),(.*)\)", line)
+ if match :
+ conditional = match.group(2)
+ if conditional == "WIN32" :
+ conditional = "win32"
+ elif conditional == "MACOSX" :
+ conditional = "mac"
+ elif match.group(2).startswith("HAVE_") :
+ conditional = "!isEmpty(" + match.group(2) + ")"
+ else :
+ conditional = "DUMMY"
+ if (match.group(1) == "n") ^ (match.group(3) not in ["1", "yes"]) :
+ conditional = "!" + conditional
+ print conditional + " {"
+ continue
+ if re.match("^if(n?)def", line) :
+ print "DUMMY {"
+ continue
+ elif re.match("^if(n?)eq", line) :
+ print "DUMMY {"
+ continue
+ if re.match("^else$", line) :
+ print "} else {"
+ continue
+ if re.match("^endif$", line) :
+ print "}"
+ continue
+
+ match = re.match("(\w+)_SOURCES (\+?)= (.*)", line)
+ if match and match.group(1) in ["SWIFT", "ZLIB", "LIBIDN", "BOOST"] :
+ inSources = processSourcesLine(match.group(3))
+ continue
+
+ match = re.match("(LIBS|CXXFLAGS|CPPFLAGS|CFLAGS) \+= (.*)", line)
+ if match :
+ processFlags(match.group(1), match.group(2))
+
+ if line.startswith("## ") :
+ print line
+
+"""
+#print sourceFiles
+sys.exit(0)
+
+print files
+pro = open ('swiftall.pri', 'w')
+for sourceType in files.keys():
+ pro.write("%s += \\\n" % sourceType)
+ for sourceFile in files[sourceType]:
+ pro.write("$$PWD/Swift/%s \\\n" % sourceFile)
+ pro.write("\n")
+pro.close()
+
+"""