summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
Diffstat (limited to 'qmake')
-rw-r--r--qmake/doc/src/qmake-manual.qdoc10
-rw-r--r--qmake/generators/projectgenerator.cpp2
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp15
-rw-r--r--qmake/generators/xmloutput.cpp10
-rw-r--r--qmake/main.cpp42
-rw-r--r--qmake/option.cpp9
6 files changed, 56 insertions, 32 deletions
diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc
index b271abcee3..3495f97b2c 100644
--- a/qmake/doc/src/qmake-manual.qdoc
+++ b/qmake/doc/src/qmake-manual.qdoc
@@ -2583,10 +2583,8 @@
\section1 RC_FILE
- Specifies the name of the resource file for the application.
- The value of this variable is typically handled by
- qmake or \l{#QMAKESPEC}{qmake.conf} and rarely
- needs to be modified.
+ Windows only. Specifies the name of the Windows resource file (.rc) for the
+ target. See \l{Adding Windows Resource Files}.
\target RC_CODEPAGE
\section1 RC_CODEPAGE
@@ -2649,7 +2647,9 @@
\section1 RES_FILE
- Specifies the name of the compiled Windows resource file for the target.
+ Windows only. Specifies the name of the Windows resource compiler's output
+ file for this target. See \l{RC_FILE} and \l{Adding Windows Resource Files}.
+
The value of this variable is typically handled by
qmake or \l{#QMAKESPEC}{qmake.conf} and rarely
needs to be modified.
diff --git a/qmake/generators/projectgenerator.cpp b/qmake/generators/projectgenerator.cpp
index ef34955eb1..19acc09e85 100644
--- a/qmake/generators/projectgenerator.cpp
+++ b/qmake/generators/projectgenerator.cpp
@@ -36,7 +36,7 @@
QT_BEGIN_NAMESPACE
-QString project_builtin_regx() //calculate the builtin regular expression..
+static QString project_builtin_regx() //calculate the builtin regular expression..
{
QString ret;
QStringList builtin_exts;
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index 38253e3a8f..506229a7f4 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -1567,21 +1567,12 @@ bool VCLinkerTool::parseOption(const char* option)
const char* str = option+6;
if (*str == 'S')
ShowProgress = linkProgressAll;
-#ifndef Q_OS_WIN
- else if (strncasecmp(str, "pginstrument", 12))
+ else if (qstricmp(str, "pginstrument") == 0)
LinkTimeCodeGeneration = optLTCGInstrument;
- else if (strncasecmp(str, "pgoptimize", 10))
+ else if (qstricmp(str, "pgoptimize") == 0)
LinkTimeCodeGeneration = optLTCGOptimize;
- else if (strncasecmp(str, "pgupdate", 8 ))
+ else if (qstricmp(str, "pgupdate") == 0)
LinkTimeCodeGeneration = optLTCGUpdate;
-#else
- else if (_stricmp(str, "pginstrument"))
- LinkTimeCodeGeneration = optLTCGInstrument;
- else if (_stricmp(str, "pgoptimize"))
- LinkTimeCodeGeneration = optLTCGOptimize;
- else if (_stricmp(str, "pgupdate"))
- LinkTimeCodeGeneration = optLTCGUpdate;
-#endif
}
} else {
AdditionalOptions.append(option);
diff --git a/qmake/generators/xmloutput.cpp b/qmake/generators/xmloutput.cpp
index e92749a126..5d96128442 100644
--- a/qmake/generators/xmloutput.cpp
+++ b/qmake/generators/xmloutput.cpp
@@ -113,7 +113,8 @@ QString XmlOutput::doConversion(const QString &text)
// this is a way to escape characters that shouldn't be converted
for (int i=0; i<text.count(); ++i) {
- if (text.at(i) == QLatin1Char('&')) {
+ const QChar c = text.at(i);
+ if (c == QLatin1Char('&')) {
if ( (i + 7) < text.count() &&
text.at(i + 1) == QLatin1Char('#') &&
text.at(i + 2) == QLatin1Char('x') &&
@@ -122,12 +123,15 @@ QString XmlOutput::doConversion(const QString &text)
} else {
output += QLatin1String("&amp;");
}
+ } else if (c == QLatin1Char('<')) {
+ output += QLatin1String("&lt;");
+ } else if (c == QLatin1Char('>')) {
+ output += QLatin1String("&gt;");
} else {
- QChar c = text.at(i);
if (c.unicode() < 0x20) {
output += QString("&#x%1;").arg(c.unicode(), 2, 16, QLatin1Char('0'));
} else {
- output += text.at(i);
+ output += c;
}
}
}
diff --git a/qmake/main.cpp b/qmake/main.cpp
index a598296898..dd1cca9633 100644
--- a/qmake/main.cpp
+++ b/qmake/main.cpp
@@ -242,6 +242,39 @@ static int doLink(int argc, char **argv)
#endif
+static bool setFilePermissions(QFile &file, QFileDevice::Permissions permissions)
+{
+ if (file.setPermissions(permissions))
+ return true;
+ fprintf(stderr, "Error setting permissions on %s: %s\n",
+ qPrintable(file.fileName()), qPrintable(file.errorString()));
+ return false;
+}
+
+static bool copyFileTimes(QFile &targetFile, const QString &sourceFilePath,
+ bool mustEnsureWritability, QString *errorString)
+{
+#ifdef Q_OS_WIN
+ bool mustRestorePermissions = false;
+ QFileDevice::Permissions targetPermissions;
+ if (mustEnsureWritability) {
+ targetPermissions = targetFile.permissions();
+ if (!targetPermissions.testFlag(QFileDevice::WriteUser)) {
+ mustRestorePermissions = true;
+ if (!setFilePermissions(targetFile, targetPermissions | QFileDevice::WriteUser))
+ return false;
+ }
+ }
+#endif
+ if (!IoUtils::touchFile(targetFile.fileName(), sourceFilePath, errorString))
+ return false;
+#ifdef Q_OS_WIN
+ if (mustRestorePermissions && !setFilePermissions(targetFile, targetPermissions))
+ return false;
+#endif
+ return true;
+}
+
static int installFile(const QString &source, const QString &target, bool exe = false,
bool preservePermissions = false)
{
@@ -270,18 +303,15 @@ static int installFile(const QString &source, const QString &target, bool exe =
targetPermissions |= QFileDevice::ExeOwner | QFileDevice::ExeUser |
QFileDevice::ExeGroup | QFileDevice::ExeOther;
}
- if (!targetFile.setPermissions(targetPermissions)) {
- fprintf(stderr, "Error setting permissions on %s: %s\n",
- qPrintable(target), qPrintable(targetFile.errorString()));
+ if (!setFilePermissions(targetFile, targetPermissions))
return 3;
- }
- // Copy file times
QString error;
- if (!IoUtils::touchFile(target, sourceFile.fileName(), &error)) {
+ if (!copyFileTimes(targetFile, sourceFile.fileName(), preservePermissions, &error)) {
fprintf(stderr, "%s", qPrintable(error));
return 3;
}
+
return 0;
}
diff --git a/qmake/option.cpp b/qmake/option.cpp
index dcebeadcb8..626a2cec0d 100644
--- a/qmake/option.cpp
+++ b/qmake/option.cpp
@@ -122,7 +122,6 @@ static QString detectProjectFile(const QString &path)
return ret;
}
-QString project_builtin_regx();
bool usage(const char *a0)
{
fprintf(stdout, "Usage: %s [mode] [options] [files]\n"
@@ -134,9 +133,9 @@ bool usage(const char *a0)
"\n"
"Mode:\n"
" -project Put qmake into project file generation mode%s\n"
- " In this mode qmake interprets files as files to\n"
- " be built,\n"
- " defaults to %s\n"
+ " In this mode qmake interprets [files] as files to\n"
+ " be added to the .pro file. By default, all files with\n"
+ " known source extensions are added.\n"
" Note: The created .pro file probably will \n"
" need to be edited. For example add the QT variable to \n"
" specify what modules are required.\n"
@@ -184,7 +183,7 @@ bool usage(const char *a0)
" -nomoc Don't generate moc targets [makefile mode only]\n"
" -nopwd Don't look for files in pwd [project mode only]\n"
,a0,
- default_mode(a0) == Option::QMAKE_GENERATE_PROJECT ? " (default)" : "", project_builtin_regx().toLatin1().constData(),
+ default_mode(a0) == Option::QMAKE_GENERATE_PROJECT ? " (default)" : "",
default_mode(a0) == Option::QMAKE_GENERATE_MAKEFILE ? " (default)" : ""
);
return false;