2016-04-22 18:05:53 +00:00
|
|
|
isEmpty(COPIES): return()
|
|
|
|
contains(TEMPLATE, .*subdirs): error("COPIES does not work with TEMPLATE=subdirs")
|
|
|
|
|
2016-07-08 17:09:49 +00:00
|
|
|
build_pass:build_all:!isEqual(BUILD_PASS, $$first(BUILDS)) {
|
2016-04-22 18:05:53 +00:00
|
|
|
# Avoid that multiple build passes race with each other.
|
|
|
|
# This will fail to copy anything if the user explicitly invokes
|
|
|
|
# only the non-primary build. This is unfixable, as at qmake time
|
|
|
|
# we cannot possibly know how make will be invoked, yet we must
|
|
|
|
# predict it here.
|
|
|
|
return()
|
|
|
|
}
|
|
|
|
|
|
|
|
defineReplace(qtStripProPwd) {
|
|
|
|
return($$relative_path($$1, $$_PRO_FILE_PWD_))
|
|
|
|
}
|
|
|
|
|
|
|
|
for (cp, COPIES) {
|
|
|
|
isEmpty($${cp}.files): next()
|
|
|
|
pfx = copy_$${cp}
|
2016-04-29 09:36:15 +00:00
|
|
|
notdir = false
|
|
|
|
dir = false
|
|
|
|
for (f, $${cp}.files) {
|
|
|
|
fil = $$absolute_path($$f, $$_PRO_FILE_PWD_)
|
|
|
|
tfiles = $$files($$fil/*)
|
|
|
|
isEmpty(tfiles): \
|
|
|
|
notdir = true
|
|
|
|
else: \
|
|
|
|
dir = true
|
|
|
|
$${pfx}.files += $$fil
|
|
|
|
}
|
|
|
|
$$dir:$$notdir: \
|
|
|
|
error("COPIES entry $$cp lists both files and directories.")
|
2016-04-22 18:05:53 +00:00
|
|
|
path = $$eval($${cp}.path)
|
2016-04-29 09:36:15 +00:00
|
|
|
isEmpty(path): error("COPIES entry $$cp defines no .path")
|
2016-04-22 18:05:53 +00:00
|
|
|
base = $$eval($${cp}.base)
|
|
|
|
isEmpty(base) {
|
2016-04-29 09:34:14 +00:00
|
|
|
$${pfx}.output = $$path/${QMAKE_FILE_IN_NAME}
|
2016-04-22 18:05:53 +00:00
|
|
|
} else: isEqual(base, $$_PRO_FILE_PWD_) {
|
|
|
|
$${pfx}.output = $$path/${QMAKE_FUNC_FILE_IN_qtStripProPwd}
|
|
|
|
} else {
|
|
|
|
eval(defineReplace(qtStripSrcDir_$$cp) { \
|
|
|
|
return(\$\$relative_path(\$\$1, $$val_escape(base))) \
|
|
|
|
})
|
|
|
|
$${pfx}.output = $$path/${QMAKE_FUNC_FILE_IN_qtStripSrcDir_$$cp}
|
|
|
|
}
|
|
|
|
$${pfx}.input = $${pfx}.files
|
2017-05-02 12:44:44 +00:00
|
|
|
$${pfx}.commands = $(QINSTALL) ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
|
2016-04-22 18:05:53 +00:00
|
|
|
$${pfx}.name = COPY ${QMAKE_FILE_IN}
|
|
|
|
$${pfx}.CONFIG = no_link no_clean target_predeps
|
|
|
|
QMAKE_EXTRA_COMPILERS += $${pfx}
|
|
|
|
}
|