From 839009c74f88e397f5bc6fad4dc5ce497072ef4b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 24 Jan 2013 20:32:30 +0100 Subject: fix duplicated installation of qml example files we need to collect the sources of the install targets for the check that all files have been properly handled, but of course we must not add these files to the source install target, as that would mean double installation. Change-Id: I6acb56f2a993b6ed81d1031d5dc0a0da30a53b54 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_example_installs.prf | 42 +++++++++++++++++++------------- 1 file changed, 25 insertions(+), 17 deletions(-) (limited to 'mkspecs') diff --git a/mkspecs/features/qt_example_installs.prf b/mkspecs/features/qt_example_installs.prf index 5417469909..5a87eeba64 100644 --- a/mkspecs/features/qt_example_installs.prf +++ b/mkspecs/features/qt_example_installs.prf @@ -9,6 +9,22 @@ # We mean it. # +defineTest(addInstallFiles) { + for(sf, 2) { + sf = $$relative_path($$sf, $$_PRO_FILE_PWD_) + contains(sf, \\..*) { + check_examples: message("Notice: $$_PRO_FILE_ refers to $$sf") + } else { + sfp = $$replace(sf, /.*, ) + !equals(sfp, $$sf): \ + $$1 *= $$sfp + else: \ + $$1 += $$sf + } + } + export($$1) +} + probase = $$relative_path($$_PRO_FILE_PWD_, $$dirname(_QMAKE_CONF_)/examples) !isEmpty(probase):!contains(probase, ^\\..*) { for(ex, EXAMPLE_FILES): \ @@ -42,34 +58,26 @@ probase = $$relative_path($$_PRO_FILE_PWD_, $$dirname(_QMAKE_CONF_)/examples) # Just for Qt Creator OTHER_FILES += $$sourcefiles - for(inst, INSTALLS): \ - !equals(inst, target):!contains($${inst}.CONFIG, no_check_exist): \ - for(file, $${inst}.files): \ - sourcefiles += $$files($$absolute_path($$file, $$_PRO_FILE_PWD_)) sourcefiles += \ $$_PRO_FILE_ $$RC_FILE $$DEF_FILE \ $$SOURCES $$HEADERS $$FORMS $$RESOURCES $$TRANSLATIONS \ $$DBUS_ADAPTORS $$DBUS_INTERFACES - for(sf, sourcefiles) { - sf = $$relative_path($$sf, $$_PRO_FILE_PWD_) - contains(sf, \\..*) { - check_examples: message("Notice: $$_PRO_FILE_ refers to $$sf") - } else { - sfp = $$replace(sf, /.*, ) - !equals(sfp, $$sf): \ - sources.files *= $$sfp - else: \ - sources.files += $$sf - } - } + addInstallFiles(sources.files, $$sourcefiles) sources.path = $$[QT_INSTALL_EXAMPLES]/$$probase INSTALLS += sources check_examples { + srcfiles = $$sources.files + for(inst, INSTALLS): \ + !equals(inst, target):!contains($${inst}.CONFIG, no_check_exist): \ + for(file, $${inst}.files): \ + instfiles += $$files($$absolute_path($$file, $$_PRO_FILE_PWD_)) + addInstallFiles(srcfiles, $$instfiles) + thefiles = $$files($$_PRO_FILE_PWD_/*) for(i, thefiles): \ allfiles += $$relative_path($$i, $$_PRO_FILE_PWD_) - for(i, sources.files): \ + for(i, srcfiles): \ allfiles -= $$relative_path($$i, $$_PRO_FILE_PWD_) for(i, SUBDIRS) { sd = $$eval($${i}.file) -- cgit v1.2.3