Commit 56993249 authored by Christian Stenger's avatar Christian Stenger

Refactor handling of statically deployed files

This is a partial fix for QTCREATORBUG-14490.

Change-Id: I014554e371c222a844c16196a1e3106fd5e45f9e
Reviewed-by: default avatarOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
parent 73cee4d6
# This pri file is used to deploy files that are not compiled while building
# Qt Creator. It handles copying of files into the build directory if using
# a shadow build and adds the respective install target as well.
#
# 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)
# 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
!isEmpty(STATIC_FILES) {
isEmpty(STATIC_BASE): \
error("Using STATIC_FILES without having STATIC_BASE set")
!isEmpty(copydata) {
copy2build.input += STATIC_FILES
copy2build.output = $$IDE_DATA_PATH/${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}
copy2build.name = COPY ${QMAKE_FILE_IN}
copy2build.config += no_link
QMAKE_EXTRA_COMPILERS += copy2build
}
!osx {
static.files = $$STATIC_FILES
static.base = $$STATIC_BASE
static.path = $$QTC_PREFIX/share/qtcreator
INSTALLS += static
}
}
include(../../qtcreator.pri)
TEMPLATE = app
TARGET = phony_target
CONFIG -= qt sdk separate_debug_info gdb_dwarf_index
......@@ -23,6 +21,9 @@ isEmpty(vcproj) {
QMAKE_EXTRA_COMPILERS += phony_src
}
STATIC_BASE = $$PWD
# files/folders that are conditionally "deployed" to the build directory
DATA_DIRS = \
welcomescreen \
examplebrowser \
......@@ -46,28 +47,14 @@ macx: DATA_DIRS += scripts
for(data_dir, DATA_DIRS) {
files = $$files($$PWD/$$data_dir/*, true)
# Info.plist.in are handled below
for(file, files):!contains(file, ".*/Info\\.plist\\.in$"):!exists($$file/*):FILES += $$file
for(file, files):!contains(file, ".*/Info\\.plist\\.in$"):!exists($$file/*): \
STATIC_FILES += $$file
}
# conditionally deployed data
!isEmpty(copydata) {
copy2build.input = FILES
copy2build.output = $$IDE_DATA_PATH/${QMAKE_FUNC_FILE_IN_stripSrcDir}
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}
copy2build.name = COPY ${QMAKE_FILE_IN}
copy2build.CONFIG += no_link
QMAKE_EXTRA_COMPILERS += copy2build
}
include(static.pri)
!macx {
for(data_dir, DATA_DIRS) {
eval($${data_dir}.files = $$quote($$PWD/$$data_dir))
eval($${data_dir}.path = $$QTC_PREFIX/share/qtcreator)
INSTALLS += $$data_dir
}
} else {
# stuff that cannot be handled by static.pri
osx {
# do version magic for app bundles
dumpinfo.input = qml/qmldump/Info.plist.in
dumpinfo.output = $$IDE_DATA_PATH/qml/qmldump/Info.plist
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment