qt5base-lts/mkspecs/features/qt_example_installs.prf
Oswald Buddenhagen f91bbd2438 make handling of qml module search path saner
excise knowledge of QTREPOS from qt.prf - this is a private variable of
the qt build system which the public functions should not know anything
about.

instead, move this handling to a function in qt_build_config.prf (where
QTREPOS comes from in the first place), and call it from qt_app.prf and
qt_example_installs.prf (which should be the only consumers within qt).

qt.prf now also checks that the qml install dir actually exists, which
is not the case during a modular prefix build of qtdeclarative.

not really incidentally, this fixes modular static builds of
qtdeclarative.

Task-number: QTBUG-57308
Change-Id: I31465b9cd400483264fc236934c6f9f26a5fdd73
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-11-25 17:31:02 +00:00

130 lines
4.2 KiB
Plaintext

#
# 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.
#
contains(TEMPLATE, .*app): \
qtSetQmlPath()
contains(TEMPLATE, "vc.*"): return()
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, ^\\..*):!isEmpty(_QMAKE_CACHE_) {
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
}
}
sourcefiles += \
$$ANDROID_PACKAGE_SOURCE_DIR \
$$QMAKE_INFO_PLIST \
$$DISTFILES
extras = \
$$_PRO_FILE_PWD_/README \
$$_PRO_FILE_PWD_/README.TXT \
$$files($$_PRO_FILE_PWD_/*.pri) \
$$replace(_PRO_FILE_, \\.pro$, .qmlproject) \
$$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
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, srcfiles): \
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")
}
equals(TEMPLATE, app)|equals(TEMPLATE, lib) {
!contains(INSTALLS, target) {
!install_ok: \
error("$$_PRO_FILE_ is lacking an install target.")
else: check_examples: \
warning("$$_PRO_FILE_ is lacking an install target.")
} else: !equals(target.path, $$sources.path) {
!install_ok: \
error("$$_PRO_FILE_ installs target to unexpected location.")
else: check_examples: \
warning("$$_PRO_FILE_ installs target to unexpected location.")
}
}
!equals(TEMPLATE, subdirs):!compile_examples {
TEMPLATE = aux
CONFIG -= have_target qt staticlib dll
SOURCES =
OBJECTIVE_SOURCES =
INSTALLS -= target
} else {
CONFIG += relative_qt_rpath # Examples built as part of Qt should be relocatable
}
}