summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@nokia.com>2010-05-17 14:14:32 (GMT)
committerJoerg Bornemann <joerg.bornemann@nokia.com>2010-05-17 14:14:32 (GMT)
commit6126d5c033e669bd57fc26093eb9be368feb12e2 (patch)
tree29390731d12d9e18177719e2ba11d8d5def0c6a1 /qmake
parent03eae990b1aea880ee863061e1429edc4a96c626 (diff)
downloadQt-6126d5c033e669bd57fc26093eb9be368feb12e2.zip
Qt-6126d5c033e669bd57fc26093eb9be368feb12e2.tar.gz
Qt-6126d5c033e669bd57fc26093eb9be368feb12e2.tar.bz2
qmake: added possibility to specify the type of an install target
Before this change: target.CONFIG+=no_check_exist implies the file is a file, no way to make an install rule for a non-existing directory. Now, its possible to specify the type: target.CONFIG+=no_check_exist directory will install a directory. target.CONFIG+=no_check_exist executable will install an executable. target.CONFIG+=no_check_exist data will install a normal file. The default case, if no type is given, like in CONFIG+=no_check_exist will call QFileInfo::isExecutable() to determine, if its a data file or executable. This is the old behaviour. Task-number: QTBUG-10624 Reviewed-by: ossi
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/makefile.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index db2737b..6b85561 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -1277,13 +1277,26 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n
}
QString local_dirstr = Option::fixPathToLocalOS(dirstr, true);
QStringList files = QDir(local_dirstr).entryList(QStringList(filestr));
- if(project->values((*it) + ".CONFIG").indexOf("no_check_exist") != -1 && files.isEmpty()) {
+ const QStringList &installConfigValues = project->values((*it) + ".CONFIG");
+ if (installConfigValues.contains("no_check_exist") && files.isEmpty()) {
if(!target.isEmpty())
target += "\t";
QString dst_file = filePrefixRoot(root, dst);
QFileInfo fi(fileInfo(wild));
- QString cmd = QString(fi.isExecutable() ? "-$(INSTALL_PROGRAM)" : "-$(INSTALL_FILE)") + " " +
- wild + " " + dst_file + "\n";
+ QString cmd;
+ if (installConfigValues.contains("directory")) {
+ cmd = QLatin1String("-$(INSTALL_DIR)");
+ if (!dst_file.endsWith(Option::dir_sep))
+ dst_file += Option::dir_sep;
+ dst_file += fi.fileName();
+ } else if (installConfigValues.contains("executable")) {
+ cmd = QLatin1String("-$(INSTALL_PROGRAM)");
+ } else if (installConfigValues.contains("data")) {
+ cmd = QLatin1String("-$(INSTALL_FILE)");
+ } else {
+ cmd = QString(fi.isExecutable() ? "-$(INSTALL_PROGRAM)" : "-$(INSTALL_FILE)");
+ }
+ cmd += " " + wild + " " + dst_file + "\n";
target += cmd;
if(!uninst.isEmpty())
uninst.append("\n\t");