[vlmc-devel] Makefile.am: Generate qrc files from qml

Hugo Beauzée-Luyssen git at videolan.org
Mon Aug 29 19:06:36 CEST 2016


vlmc | branch: medialibrary | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Aug 29 19:05:21 2016 +0200| [e23cd66e83ff539b64e2ea0d36c71a815bad8b13] | committer: Hugo Beauzée-Luyssen

Makefile.am: Generate qrc files from qml

This automatically tracks modifications to QML files, and will rebuild
a resource file out of it

> https://code.videolan.org/videolan/vlmc/commit/e23cd66e83ff539b64e2ea0d36c71a815bad8b13
---

 Makefile.am                                 | 20 ++++++++++++++++----
 src/Gui/effectsengine/resources-effects.qrc |  6 ------
 src/Gui/timeline/resources-timeline.qrc     | 14 --------------
 3 files changed, 16 insertions(+), 24 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 038a462..49589b7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,7 +2,7 @@ ACLOCAL_AMFLAGS = -I m4
 
 bin_PROGRAMS = vlmc
 
-SUFFIXES = .ui .h .moc.cpp
+SUFFIXES = .ui .h .moc.cpp .qrc .qml
 
 vlmc_SOURCES = \
 	src/Commands/Commands.cpp \
@@ -130,8 +130,6 @@ nodist_vlmc_SOURCES = \
 
 vlmc_RC = \
 	$(top_srcdir)/resources.qrc \
-	$(top_srcdir)/src/Gui/timeline/resources-timeline.qrc \
-	$(top_srcdir)/src/Gui/effectsengine/resources-effects.qrc \
 	$(NULL)
 
 EXTRA_DIST = $(vlmc_RC)
@@ -394,9 +392,12 @@ vlmc_QML = \
 
 EXTRA_DIST += $(vlmc_QML)
 
+vlmc_RC += $(vlmc_QML:.qml=.qrc)
+nodist_vlmc_SOURCES += $(vlmc_QML:.qml=.qrc)
+
 endif
 
-resources.cpp:
+resources.cpp: $(vlmc_QML)
 	$(RCC) -o $@ $(vlmc_RC)
 
 nodist_vlmc_SOURCES += resources.cpp
@@ -418,6 +419,17 @@ uic_verbose__0 = $(uic_verbose_0)
 	$(AM_V_at)mkdir -p $(@D)
 	$(uic_verbose)$(UIC) -p $< -o $@
 
+qmlrc_verbose = $(qmlrc_verbose_$(V))
+qmlrc_verbose_ = $(qmlrc_verbose__$(AM_DEFAULT_VERBOSITY))
+qmlrc_verbose_0 = @echo "  QML->QRC   " $@;
+qmlrc_verbose__0 = $(qmlrc_verbose_0)
+
+.qml.qrc:
+	$(AM_V_at)mkdir -p $(@D)
+	$(qmlrc_verbose)echo "<RCC><qresource prefix=\"/QML\">\
+		<file alias=\"$(<F)\">$(abs_top_builddir)/$<</file>\
+		</qresource></RCC>" > $@
+
 BUILT_SOURCES = $(nodist_vlmc_SOURCES)
 CLEANFILES = $(BUILT_SOURCES)
 
diff --git a/src/Gui/effectsengine/resources-effects.qrc b/src/Gui/effectsengine/resources-effects.qrc
deleted file mode 100644
index 8212976..0000000
--- a/src/Gui/effectsengine/resources-effects.qrc
+++ /dev/null
@@ -1,6 +0,0 @@
-<RCC>
-    <qresource prefix="/QML">
-        <file>EffectsListView.qml</file>
-        <file>Effect.qml</file>
-    </qresource>
-</RCC>
diff --git a/src/Gui/timeline/resources-timeline.qrc b/src/Gui/timeline/resources-timeline.qrc
deleted file mode 100644
index 4caecdf..0000000
--- a/src/Gui/timeline/resources-timeline.qrc
+++ /dev/null
@@ -1,14 +0,0 @@
-<RCC>
-    <qresource lang="QML" prefix="/QML">
-        <file>main.qml</file>
-        <file>Ruler.qml</file>
-        <file>Track.qml</file>
-        <file>TrackContainer.qml</file>
-        <file>Marker.qml</file>
-        <file>Cursor.qml</file>
-        <file>Clip.qml</file>
-        <file>ClipContextMenu.qml</file>
-        <file>PropertyButton.qml</file>
-        <file>MarkerContextMenu.qml</file>
-    </qresource>
-</RCC>



More information about the Vlmc-devel mailing list