changeset 17952:96c76878c7c6

Include <config.h> in C++ files generated from resources. * libgui/Makefile.am (rcc-command): New variable. (qr-%.cc): Use it to translate resources to C++.
author Michael Goffioul <michael.goffioul@gmail.com>
date Mon, 18 Nov 2013 19:11:29 -0500
parents c02b8bf0e1f9
children f792a5c15b46
files libgui/Makefile.am
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/Makefile.am	Mon Nov 18 15:07:01 2013 -0800
+++ b/libgui/Makefile.am	Mon Nov 18 19:11:29 2013 -0500
@@ -94,6 +94,14 @@
 mv $@-t $@
 endef
 
+define rcc-command
+( echo '#ifdef HAVE_CONFIG_H'; \
+  echo '#include <config.h>'; \
+  echo '#endif'; \
+  $(RCC) $< ) > $@-t
+mv $@-t $@
+endef
+
 moc-%.cc: %.h
 	$(moc-command)
 
@@ -101,7 +109,7 @@
 	$(UIC) -o $@ $<
 
 qrc-%.cc: %.qrc
-	$(RCC) -o $@ $<
+	$(rcc-command)
 
 %.qm: %.ts
 	$(MKDIR_P) languages