diff options
author | Eike Ziller <eike.ziller@theqtcompany.com> | 2016-03-23 13:31:04 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@theqtcompany.com> | 2016-04-12 12:30:33 +0000 |
commit | 2a3e342740bd09099198890072296ef3be221ec1 (patch) | |
tree | d2763873e79593c6d8a893d42d64695d8dd0c029 /qtcreatordata.pri | |
parent | 3a7ce3f5be9af510634ae018e27d3b1a2970063a (diff) | |
download | qt-creator-2a3e342740bd09099198890072296ef3be221ec1.tar.gz |
Remove code duplication for copying resources.
qtcreatordata.pri was created for "conditional" copying of resources to the
build tree. Adapt it a bit and use it for the "unconditionally" copied
resources as well.
A side effect is, that the unconditionally copied resources now are
also installed file by file instead of the directory as a whole,
which doesn't make a difference in the end result though.
Change-Id: I6da3eeaadcb48c19987858bbb8c2d42ee149f6f3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Diffstat (limited to 'qtcreatordata.pri')
-rw-r--r-- | qtcreatordata.pri | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/qtcreatordata.pri b/qtcreatordata.pri index 27a21263f1..75251ccf0b 100644 --- a/qtcreatordata.pri +++ b/qtcreatordata.pri @@ -4,24 +4,28 @@ # # Usage: Define variables (details below) and include this pri file afterwards. # -# STATIC_BASE - base directory for the files listed in STATIC_FILES -# STATIC_FILES - list of files to be deployed - -include(qtcreator.pri) +# STATIC_BASE - base directory for the files listed in STATIC_FILES +# STATIC_FILES - list of files to be deployed +# STATIC_OUTPUT_BASE - base directory in the compile output +# STATIC_INSTALL_BASE - base directory in the install output # used in custom compilers which just copy files defineReplace(stripStaticBase) { return($$relative_path($$1, $$STATIC_BASE)) } -# handle conditional copying; copydata will be set by qtcreator.pri +# handle conditional copying based on STATIC_BASE compared to STATIC_OUTPUT_BASE !isEmpty(STATIC_FILES) { isEmpty(STATIC_BASE): \ error("Using STATIC_FILES without having STATIC_BASE set") + isEmpty(STATIC_OUTPUT_BASE): \ + error("Using STATIC_FILES without having STATIC_OUTPUT_BASE set") + !osx:isEmpty(STATIC_INSTALL_BASE): \ + error("Using STATIC_FILES without having STATIC_INSTALL_BASE set") - !isEmpty(copydata) { + !isEqual(STATIC_BASE, $$STATIC_OUTPUT_BASE) { copy2build.input += STATIC_FILES - copy2build.output = $$IDE_DATA_PATH/${QMAKE_FUNC_FILE_IN_stripStaticBase} + copy2build.output = $$STATIC_OUTPUT_BASE/${QMAKE_FUNC_FILE_IN_stripStaticBase} isEmpty(vcproj):copy2build.variable_out = PRE_TARGETDEPS win32:copy2build.commands = $$QMAKE_COPY \"${QMAKE_FILE_IN}\" \"${QMAKE_FILE_OUT}\" unix:copy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} @@ -33,7 +37,7 @@ defineReplace(stripStaticBase) { !osx { static.files = $$STATIC_FILES static.base = $$STATIC_BASE - static.path = $$INSTALL_DATA_PATH + static.path = $$STATIC_INSTALL_BASE INSTALLS += static } } |