2012-12-11 21:08:15 +00:00
|
|
|
#
|
|
|
|
# W A R N I N G
|
|
|
|
# -------------
|
|
|
|
#
|
|
|
|
# This file is not part of the Qt API. It exists purely as an
|
|
|
|
# implementation detail. It may change from version to version
|
|
|
|
# without notice, or even be removed.
|
|
|
|
#
|
|
|
|
# We mean it.
|
|
|
|
#
|
|
|
|
|
2015-09-02 11:05:47 +00:00
|
|
|
contains(TEMPLATE, "vc.*"): return()
|
|
|
|
|
2013-01-24 19:32:30 +00:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
|
2012-11-27 19:40:16 +00:00
|
|
|
probase = $$relative_path($$_PRO_FILE_PWD_, $$dirname(_QMAKE_CONF_)/examples)
|
2013-03-19 16:38:30 +00:00
|
|
|
!isEmpty(probase):!contains(probase, ^\\..*):!isEmpty(_QMAKE_CACHE_) {
|
2012-11-27 19:40:16 +00:00
|
|
|
for(ex, EXAMPLE_FILES): \
|
|
|
|
sourcefiles += $$files($$absolute_path($$ex, $$_PRO_FILE_PWD_))
|
|
|
|
for(res, RESOURCES) {
|
|
|
|
rfile = $$cat($$absolute_path($$res, $$_PRO_FILE_PWD_), lines)
|
|
|
|
for(rline, rfile) {
|
|
|
|
resrc = $$replace(rline, ^[ \\t]*<file[^>]*>([^<]+)</file>[ \\t]*$, \\1)
|
|
|
|
!equals(resrc, $$rline): \
|
|
|
|
sourcefiles += $$resrc
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for(res, RC_FILE) {
|
|
|
|
rfile = $$cat($$absolute_path($$res, $$_PRO_FILE_PWD_), lines)
|
|
|
|
for(rline, rfile) {
|
|
|
|
resrc = $$replace(rline, "^\\d+\\s+ICON\\s+[^\"]*\"([^\"]+)\"\$", \\1)
|
|
|
|
!equals(resrc, $$rline): \
|
|
|
|
sourcefiles += $$resrc
|
|
|
|
}
|
|
|
|
}
|
2016-04-21 18:02:20 +00:00
|
|
|
sourcefiles += \
|
|
|
|
$$ANDROID_PACKAGE_SOURCE_DIR \
|
|
|
|
$$QMAKE_INFO_PLIST \
|
|
|
|
$$DISTFILES
|
2012-11-27 19:40:16 +00:00
|
|
|
extras = \
|
|
|
|
$$_PRO_FILE_PWD_/README \
|
2016-04-21 18:02:20 +00:00
|
|
|
$$_PRO_FILE_PWD_/README.TXT \
|
2012-11-27 19:40:16 +00:00
|
|
|
$$files($$_PRO_FILE_PWD_/*.pri) \
|
2012-11-30 15:50:05 +00:00
|
|
|
$$replace(_PRO_FILE_, \\.pro$, .qmlproject) \
|
2012-11-27 19:40:16 +00:00
|
|
|
$$replace(_PRO_FILE_, \\.pro$, .json) \
|
|
|
|
$$replace(_PRO_FILE_, \\.pro$, .inf)
|
|
|
|
for(extra, extras): \
|
|
|
|
exists($$extra): \
|
|
|
|
sourcefiles += $$extra
|
|
|
|
|
|
|
|
# Just for Qt Creator
|
|
|
|
OTHER_FILES += $$sourcefiles
|
|
|
|
|
|
|
|
sourcefiles += \
|
|
|
|
$$_PRO_FILE_ $$RC_FILE $$DEF_FILE \
|
|
|
|
$$SOURCES $$HEADERS $$FORMS $$RESOURCES $$TRANSLATIONS \
|
|
|
|
$$DBUS_ADAPTORS $$DBUS_INTERFACES
|
2013-01-24 19:32:30 +00:00
|
|
|
addInstallFiles(sources.files, $$sourcefiles)
|
2012-11-27 19:40:16 +00:00
|
|
|
sources.path = $$[QT_INSTALL_EXAMPLES]/$$probase
|
|
|
|
INSTALLS += sources
|
|
|
|
|
|
|
|
check_examples {
|
2013-01-24 19:32:30 +00:00
|
|
|
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)
|
|
|
|
|
2012-11-27 19:40:16 +00:00
|
|
|
thefiles = $$files($$_PRO_FILE_PWD_/*)
|
|
|
|
for(i, thefiles): \
|
|
|
|
allfiles += $$relative_path($$i, $$_PRO_FILE_PWD_)
|
2013-01-24 19:32:30 +00:00
|
|
|
for(i, srcfiles): \
|
2012-11-27 19:40:16 +00:00
|
|
|
allfiles -= $$relative_path($$i, $$_PRO_FILE_PWD_)
|
|
|
|
for(i, SUBDIRS) {
|
|
|
|
sd = $$eval($${i}.file)
|
|
|
|
!isEmpty(sd) {
|
|
|
|
sd ~= s,/.*,,
|
|
|
|
} else {
|
|
|
|
sd = $$eval($${i}.subdir)
|
|
|
|
isEmpty(sd): sd = $$i
|
|
|
|
}
|
|
|
|
allfiles -= $$sd
|
|
|
|
}
|
|
|
|
allfiles -= doc
|
|
|
|
!isEmpty(allfiles): warning("remaining files in $$_PRO_FILE_PWD_: $$allfiles")
|
|
|
|
}
|
2012-12-21 18:36:12 +00:00
|
|
|
|
2013-05-07 15:10:22 +00:00
|
|
|
!equals(TEMPLATE, subdirs):!compile_examples {
|
2012-12-21 18:36:12 +00:00
|
|
|
TEMPLATE = aux
|
|
|
|
CONFIG -= have_target qt staticlib dll
|
|
|
|
SOURCES =
|
2014-01-06 17:23:19 +00:00
|
|
|
OBJECTIVE_SOURCES =
|
2012-12-21 18:36:12 +00:00
|
|
|
INSTALLS -= target
|
2015-06-05 15:45:47 +00:00
|
|
|
} else {
|
|
|
|
CONFIG += relative_qt_rpath # Examples built as part of Qt should be relocatable
|
2012-12-21 18:36:12 +00:00
|
|
|
}
|
2012-11-27 19:40:16 +00:00
|
|
|
}
|