diff options
author | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-04-29 11:36:15 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-05-02 18:35:02 +0000 |
commit | 8f0bf2d3d258acfae91e7dda2d1e7ad29b950c9b (patch) | |
tree | 7781f0ce95e00bd5beeae168598a779c82eeb10c /mkspecs/features/file_copies.prf | |
parent | 49f92f9ab75f5fcc086543d9dbcc025c37677715 (diff) |
support directories in COPIES
this makes it fully consistent with INSTALLS.
note that this also removes the file name from the target path when
copying files, also for consistency.
Change-Id: I69042c9aa1e2cc81f8ff982343ba25688a04abfd
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'mkspecs/features/file_copies.prf')
-rw-r--r-- | mkspecs/features/file_copies.prf | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/mkspecs/features/file_copies.prf b/mkspecs/features/file_copies.prf index 04a02258d5..6df294212c 100644 --- a/mkspecs/features/file_copies.prf +++ b/mkspecs/features/file_copies.prf @@ -18,10 +18,21 @@ defineReplace(qtStripProPwd) { for (cp, COPIES) { isEmpty($${cp}.files): next() pfx = copy_$${cp} - for (f, $${cp}.files): \ - $${pfx}.files += $$absolute_path($$f, $$_PRO_FILE_PWD_) + 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.") path = $$eval($${cp}.path) - isEmpty(path): error("COPY $cp defines no .path") + isEmpty(path): error("COPIES entry $$cp defines no .path") base = $$eval($${cp}.base) isEmpty(base) { $${pfx}.output = $$path/${QMAKE_FILE_IN_NAME} @@ -34,7 +45,12 @@ for (cp, COPIES) { $${pfx}.output = $$path/${QMAKE_FUNC_FILE_IN_qtStripSrcDir_$$cp} } $${pfx}.input = $${pfx}.files - $${pfx}.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} + !$$dir: \ + $${pfx}.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT_PATH} + else: !copy_dir_files: \ + $${pfx}.commands = $$QMAKE_COPY_DIR ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT_PATH} + else: \ + $${pfx}.commands = $$QMAKE_COPY_DIR ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} $${pfx}.name = COPY ${QMAKE_FILE_IN} $${pfx}.CONFIG = no_link no_clean target_predeps QMAKE_EXTRA_COMPILERS += $${pfx} |