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 <joerg.bornemann@digia.com>
This commit is contained in:
Oswald Buddenhagen 2013-01-24 20:32:30 +01:00 committed by The Qt Project
parent 7c38be7e0c
commit 839009c74f

View File

@ -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)