More waf magic in order to please both waf and qt resource generation
According to docs, resources specified in qrc file MUST be relative to
qrc file and there is no way around. Previously generated qrc file was
only in build/ directory.
Change-Id: I5cf12fc9c184a1ce8a29075edd3da60b433e05cd
diff --git a/.gitignore b/.gitignore
index 53e0e87..176dcee 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,3 +12,4 @@
osx/Frameworks/Sparkle.framework
Sparkle*
*priv.pem
+gui/html.qrc
diff --git a/wscript b/wscript
index d98f134..229824d 100644
--- a/wscript
+++ b/wscript
@@ -288,20 +288,23 @@
def create_qrc_task(self):
output = self.bld.path.find_or_declare ("gui/html.qrc")
tsk = self.create_task('html_resources', self.html_resources, output)
- self.create_rcc_task (output)
+ tsk.base_path = output.parent.get_src ()
+ self.create_rcc_task (output.get_src ())
class html_resources(Task.Task):
color='PINK'
def __str__ (self):
- return "%s: Generating %s\n" % (self.__class__.__name__.replace('_task',''), self.outputs[0])
+ return "%s: Generating %s\n" % (self.__class__.__name__.replace('_task',''), self.outputs[0].nice_path ())
def run (self):
out = self.outputs[0]
out.write('<RCC>\n <qresource prefix="/">\n')
for f in self.inputs:
- out.write (' <file>%s</file>\n' % f.abspath (), 'a')
+ out.write (' <file>%s</file>\n' % f.path_from (self.base_path), 'a')
out.write(' </qresource>\n</RCC>', 'a')
+
+ out.get_src ().write (out.read(), 'w')
return 0
@Configure.conf