summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2012-04-23 18:49:59 (GMT)
committerRemko Tronçon <git@el-tramo.be>2012-04-23 18:54:15 (GMT)
commit2d436118c2a3907080fa850a3dcab2e99120a7bc (patch)
treedb58ae8755e8f2961b412052037d719b06e24b42
parent5af9a5c5cd4d74b29ce5bf4882b5b8391f09b468 (diff)
downloadswift-contrib-2d436118c2a3907080fa850a3dcab2e99120a7bc.zip
swift-contrib-2d436118c2a3907080fa850a3dcab2e99120a7bc.tar.bz2
Use command to generate RTF file.
This avoids the COPYING file being read on each compile.
-rw-r--r--Swift/QtUI/SConscript19
1 files changed, 11 insertions, 8 deletions
diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript
index 06c5bc4..b6f6229 100644
--- a/Swift/QtUI/SConscript
+++ b/Swift/QtUI/SConscript
@@ -282,14 +282,17 @@ if env["PLATFORM"] == "win32" :
#myenv.Nsis("../Packaging/nsis/swift.nsi")
#myenv.WiX("../Packaging/wix/swift.msi", ["../Packaging/WiX/Swift.wxs"])
if env["SCONS_STAGE"] == "build" and env.get("wix_bindir", None):
- licensefile = open('../../COPYING', 'r')
- rtf = '{\\rtf1\\ansi{\\fonttbl\\f0\\fswiss Helvetica;}\\f0\\pard'
- for line in licensefile:
- rtf += line
- rtf += '\\par'
- rtf += '}'
- licensefile.close()
- myenv.WriteVal("Swift/COPYING.rtf", env.Value(rtf))
+ def convertToRTF(env, target, source) :
+ infile = open(source[0].abspath, 'r')
+ outfile = open(target[0].abspath, 'w')
+ outfile.write('{\\rtf1\\ansi{\\fonttbl\\f0\\fswiss Helvetica;}\\f0\\pard\n')
+ for line in infile:
+ outfile.write(line)
+ outfile.write('\\par')
+ outfile.write('}')
+ outfile.close()
+ infile.close()
+ env.Command(["Swift/COPYING.rtf"], ["../../COPYING"], convertToRTF)
wixvariables = {'VCCRTFile': env.get("vcredist", "c:\\Program Files\\Common Files\\Merge Modules") + "\\Microsoft_VC90_CRT_x86.msm"}
wixincludecontent = "<Include>"