summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorGuoqing Zhang <guoqing.zhang@nokia.com>2011-03-16 13:29:20 +0200
committerGuoqing Zhang <guoqing.zhang@nokia.com>2011-03-16 13:29:20 +0200
commit39dcac49c9a20eaa9b347276d97547461c3904aa (patch)
tree8a0cc8574bed910f24438ee0fe5fb961021b3a65 /qmake
parent82198dd1f7049cec89271b0ea82521752cc13c05 (diff)
parente318b0276c3d4a0db8660b4fa6d68f1784aee522 (diff)
Merge remote branch 'qt-master/master'
Conflicts: src/corelib/thread/qthread_unix.cpp
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp2
-rw-r--r--qmake/generators/symbian/symmake_sbsv2.cpp5
-rw-r--r--qmake/generators/unix/unixmake2.cpp18
-rw-r--r--qmake/generators/win32/mingw_make.cpp6
-rw-r--r--qmake/generators/win32/msvc_nmake.cpp6
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp8
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp69
-rw-r--r--qmake/generators/win32/msvc_vcproj.h1
-rw-r--r--qmake/generators/win32/winmakefile.cpp4
-rw-r--r--qmake/option.h9
10 files changed, 59 insertions, 69 deletions
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index 0ec946ecd1..19667cdbe4 100644
--- a/qmake/generators/mac/pbuilder_pbx.cpp
+++ b/qmake/generators/mac/pbuilder_pbx.cpp
@@ -1272,6 +1272,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
plist_in_text = plist_in_text.replace("@EXECUTABLE@", project->first("QMAKE_ORIG_TARGET"));
} else {
plist_in_text = plist_in_text.replace("@LIBRARY@", project->first("QMAKE_ORIG_TARGET"));
+ }
+ if (!project->values("VERSION").isEmpty()) {
plist_in_text = plist_in_text.replace("@SHORT_VERSION@", project->first("VER_MAJ") + "." +
project->first("VER_MIN"));
}
diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp
index 6f532886a4..767645ac2d 100644
--- a/qmake/generators/symbian/symmake_sbsv2.cpp
+++ b/qmake/generators/symbian/symmake_sbsv2.cpp
@@ -733,7 +733,10 @@ void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t
QStringList absoluteCleanFiles;
foreach (QString cleanFile, cleanFiles) {
QFileInfo fi(cleanFile);
- absoluteCleanFiles << fi.absoluteFilePath();
+ QString fileName = QLatin1String("\"");
+ fileName.append(fi.absoluteFilePath());
+ fileName.append(QLatin1String("\""));
+ absoluteCleanFiles << fileName;
}
t << "START EXTENSION qt/qmake_clean" << endl;
t << "OPTION CLEAN_FILES " << absoluteCleanFiles.join(" ") << endl;
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp
index 5ea13f4864..212f8bd22b 100644
--- a/qmake/generators/unix/unixmake2.cpp
+++ b/qmake/generators/unix/unixmake2.cpp
@@ -712,11 +712,18 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << info_plist_out << ": " << "\n\t";
if(!destdir.isEmpty())
t << mkdir_p_asstring(destdir) << "\n\t";
+ QStringList commonSedArgs;
+ if (!project->values("VERSION").isEmpty())
+ commonSedArgs << "-e \"s,@SHORT_VERSION@," << project->first("VER_MAJ") << "." << project->first("VER_MIN") << ",g\" ";
+ commonSedArgs << "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ?
+ QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" ";
if(project->first("TEMPLATE") == "app") {
QString icon = fileFixify(var("ICON"));
t << "@$(DEL_FILE) " << info_plist_out << "\n\t"
- << "@sed "
- << "-e \"s,@ICON@," << icon.section(Option::dir_sep, -1) << ",g\" "
+ << "@sed ";
+ foreach (const QString &arg, commonSedArgs)
+ t << arg;
+ t << "-e \"s,@ICON@," << icon.section(Option::dir_sep, -1) << ",g\" "
<< "-e \"s,@EXECUTABLE@," << var("QMAKE_ORIG_TARGET") << ",g\" "
<< "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ?
QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" "
@@ -732,9 +739,10 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
}
} else {
t << "@$(DEL_FILE) " << info_plist_out << "\n\t"
- << "@sed "
- << "-e \"s,@LIBRARY@," << var("QMAKE_ORIG_TARGET") << ",g\" "
- << "-e \"s,@SHORT_VERSION@," << project->first("VER_MAJ") << "." << project->first("VER_MIN") << ",g\" "
+ << "@sed ";
+ foreach (const QString &arg, commonSedArgs)
+ t << arg;
+ t << "-e \"s,@LIBRARY@," << var("QMAKE_ORIG_TARGET") << ",g\" "
<< "-e \"s,@TYPEINFO@,"
<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ?
QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" "
diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp
index 26393325c9..462920e06c 100644
--- a/qmake/generators/win32/mingw_make.cpp
+++ b/qmake/generators/win32/mingw_make.cpp
@@ -302,8 +302,10 @@ void MingwMakefileGenerator::init()
project->values("QMAKE_LFLAGS").append(QString("-Wl,--out-implib,") + project->first("MINGW_IMPORT_LIB"));
}
- if(!project->values("DEF_FILE").isEmpty() && project->values("QMAKE_SYMBIAN_SHLIB").isEmpty())
- project->values("QMAKE_LFLAGS").append(QString("-Wl,") + project->first("DEF_FILE"));
+ if(!project->values("DEF_FILE").isEmpty() && project->values("QMAKE_SYMBIAN_SHLIB").isEmpty()) {
+ QString defFileName = fileFixify(project->values("DEF_FILE")).first();
+ project->values("QMAKE_LFLAGS").append(QString("-Wl,") + escapeFilePath(defFileName));
+ }
MakefileGenerator::init();
diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp
index 1b2cd1810c..c55806d002 100644
--- a/qmake/generators/win32/msvc_nmake.cpp
+++ b/qmake/generators/win32/msvc_nmake.cpp
@@ -218,8 +218,10 @@ void NmakeMakefileGenerator::init()
project->values("QMAKE_LIBS") += escapeFilePaths(project->values("RES_FILE"));
}
- if(!project->values("DEF_FILE").isEmpty())
- project->values("QMAKE_LFLAGS").append(QString("/DEF:") + escapeFilePath(project->first("DEF_FILE")));
+ if (!project->values("DEF_FILE").isEmpty()) {
+ QString defFileName = fileFixify(project->values("DEF_FILE")).first();
+ project->values("QMAKE_LFLAGS").append(QString("/DEF:") + escapeFilePath(defFileName));
+ }
if(!project->values("VERSION").isEmpty()) {
QString version = project->values("VERSION")[0];
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index 69cfc0d121..020c3d8026 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -857,11 +857,11 @@ bool VCCLCompilerTool::parseOption(const char* option)
break;
case 'X':
UsePrecompiledHeader = pchGenerateAuto;
- PrecompiledHeaderFile = option+3;
+ PrecompiledHeaderThrough = option+3;
break;
case 'c':
UsePrecompiledHeader = pchCreateUsingSpecific;
- PrecompiledHeaderFile = option+3;
+ PrecompiledHeaderThrough = option+3;
break;
case 'd':
case 'l':
@@ -869,7 +869,7 @@ bool VCCLCompilerTool::parseOption(const char* option)
break;
case 'u':
UsePrecompiledHeader = pchUseUsingSpecific;
- PrecompiledHeaderFile = option+3;
+ PrecompiledHeaderThrough = option+3;
break;
default:
found = false; break;
@@ -2104,7 +2104,7 @@ void VCFilter::modifyPCHstage(QString str)
break;
}
}
- bool isHFile = str.endsWith(".h") && (str == Project->precompH);
+ bool isHFile = Option::hasFileExtension(str, Option::h_ext) && (str == Project->precompH);
bool isCPPFile = pchThroughSourceFile && (str == Project->precompCPP);
if(!isCFile && !isHFile && !isCPPFile)
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index 0df33d0328..80f5bde8c8 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -878,22 +878,16 @@ void VcprojGenerator::initConfiguration()
break;
}
+ conf.OutputDirectory = project->first("DESTDIR");
+ if (conf.OutputDirectory.isEmpty())
+ conf.OutputDirectory = ".\\";
+ if (!conf.OutputDirectory.endsWith("\\"))
+ conf.OutputDirectory += '\\';
if (conf.CompilerVersion >= NET2010) {
- conf.OutputDirectory = project->first("DESTDIR");
-
- if(conf.OutputDirectory.isEmpty())
- conf.OutputDirectory = ".\\";
-
- if(!conf.OutputDirectory.endsWith("\\"))
- conf.OutputDirectory += '\\';
-
// The target name could have been changed.
conf.PrimaryOutput = project->first("TARGET");
if ( !conf.PrimaryOutput.isEmpty() && !project->first("TARGET_VERSION_EXT").isEmpty() && project->isActiveConfig("shared"))
conf.PrimaryOutput.append(project->first("TARGET_VERSION_EXT"));
- } else {
- conf.PrimaryOutput = project->first("PrimaryOutput");
- conf.OutputDirectory = ".";
}
conf.Name = project->values("BUILD_NAME").join(" ");
@@ -982,13 +976,7 @@ void VcprojGenerator::initCompilerTool()
void VcprojGenerator::initLibrarianTool()
{
VCConfiguration &conf = vcProject.Configuration;
- conf.librarian.OutputFile = project->first("DESTDIR");
- if(conf.librarian.OutputFile.isEmpty())
- conf.librarian.OutputFile = ".\\";
-
- if(!conf.librarian.OutputFile.endsWith("\\"))
- conf.librarian.OutputFile += '\\';
-
+ conf.librarian.OutputFile = "$(OutDir)\\";
conf.librarian.OutputFile += project->first("MSVCPROJ_TARGET");
conf.librarian.AdditionalOptions += project->values("QMAKE_LIBFLAGS");
}
@@ -1018,24 +1006,7 @@ void VcprojGenerator::initLinkerTool()
}
}
- switch (projectTarget) {
- case Application:
- conf.linker.OutputFile = project->first("DESTDIR");
- break;
- case SharedLib:
- conf.linker.parseOptions(project->values("MSVCPROJ_LIBOPTIONS"));
- conf.linker.OutputFile = project->first("DESTDIR");
- break;
- case StaticLib: //unhandled - added to remove warnings..
- break;
- }
-
- if(conf.linker.OutputFile.isEmpty())
- conf.linker.OutputFile = ".\\";
-
- if(!conf.linker.OutputFile.endsWith("\\"))
- conf.linker.OutputFile += '\\';
-
+ conf.linker.OutputFile = "$(OutDir)\\";
conf.linker.OutputFile += project->first("MSVCPROJ_TARGET");
if(project->isActiveConfig("dll")){
@@ -1054,7 +1025,7 @@ void VcprojGenerator::initResourceTool()
if(project->isActiveConfig("debug"))
conf.resource.PreprocessorDefinitions += "_DEBUG";
if(project->isActiveConfig("staticlib"))
- conf.resource.ResourceOutputFileName = project->first("DESTDIR") + "/$(InputName).res";
+ conf.resource.ResourceOutputFileName = "$(OutDir)\\$(InputName).res";
}
void VcprojGenerator::initIDLTool()
@@ -1072,22 +1043,26 @@ void VcprojGenerator::initPreBuildEventTools()
void VcprojGenerator::initPostBuildEventTools()
{
VCConfiguration &conf = vcProject.Configuration;
- if(!project->values("QMAKE_POST_LINK").isEmpty()) {
+ if (!project->values("QMAKE_POST_LINK").isEmpty()) {
QStringList cmdline = VCToolBase::fixCommandLine(var("QMAKE_POST_LINK"));
conf.postBuild.CommandLine = cmdline;
conf.postBuild.Description = cmdline.join(QLatin1String("\r\n"));
+ conf.postBuild.ExcludedFromBuild = _False;
}
QString signature = !project->isEmpty("SIGNATURE_FILE") ? var("SIGNATURE_FILE") : var("DEFAULT_SIGNATURE");
bool useSignature = !signature.isEmpty() && !project->isActiveConfig("staticlib") &&
!project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH");
- if(useSignature)
+ if (useSignature) {
conf.postBuild.CommandLine.prepend(
QLatin1String("signtool sign /F ") + signature + QLatin1String(" \"$(TargetPath)\""));
+ conf.postBuild.ExcludedFromBuild = _False;
+ }
- if(!project->values("MSVCPROJ_COPY_DLL").isEmpty()) {
+ if (!project->values("MSVCPROJ_COPY_DLL").isEmpty()) {
conf.postBuild.Description += var("MSVCPROJ_COPY_DLL_DESC");
conf.postBuild.CommandLine += var("MSVCPROJ_COPY_DLL");
+ conf.postBuild.ExcludedFromBuild = _False;
}
}
@@ -1218,6 +1193,7 @@ void VcprojGenerator::initPreLinkEventTools()
QStringList cmdline = VCToolBase::fixCommandLine(var("QMAKE_PRE_LINK"));
conf.preLink.CommandLine = cmdline;
conf.preLink.Description = cmdline.join(QLatin1String("\r\n"));
+ conf.preLink.ExcludedFromBuild = _False;
}
}
@@ -1577,19 +1553,6 @@ QString VcprojGenerator::findTemplate(QString file)
return ret;
}
-void VcprojGenerator::processPrlVariable(const QString &var, const QStringList &l)
-{
- if(var == "QMAKE_PRL_DEFINES") {
- QStringList &out = project->values("MSVCPROJ_DEFINES");
- for(QStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
- if(out.indexOf((*it)) == -1)
- out.append((" /D " + *it));
- }
- } else {
- MakefileGenerator::processPrlVariable(var, l);
- }
-}
-
void VcprojGenerator::outputVariables()
{
#if 0
diff --git a/qmake/generators/win32/msvc_vcproj.h b/qmake/generators/win32/msvc_vcproj.h
index 656afa99c1..fdcd73f82d 100644
--- a/qmake/generators/win32/msvc_vcproj.h
+++ b/qmake/generators/win32/msvc_vcproj.h
@@ -92,7 +92,6 @@ protected:
virtual bool mergeBuildProject(MakefileGenerator *other);
virtual bool openOutput(QFile &file, const QString &build) const;
- virtual void processPrlVariable(const QString &, const QStringList &);
virtual bool findLibraries();
virtual void outputVariables();
QString fixFilename(QString ofile) const;
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index c85533b1cf..ef234ec506 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -456,6 +456,10 @@ void Win32MakefileGenerator::processRcFileVar()
ts << "\t\t\t\tVALUE \"ProductName\", \"" << productName << "\\0\"" << endl;
ts << "\t\t\tEND" << endl;
ts << "\t\tEND" << endl;
+ ts << "\t\tBLOCK \"VarFileInfo\"" << endl;
+ ts << "\t\tBEGIN" << endl;
+ ts << "\t\t\tVALUE \"Translation\", 0x409, 1200" << endl;
+ ts << "\t\tEND" << endl;
ts << "\tEND" << endl;
ts << "/* End of Version info */" << endl;
ts << endl;
diff --git a/qmake/option.h b/qmake/option.h
index e3ddc9a975..bc873438e1 100644
--- a/qmake/option.h
+++ b/qmake/option.h
@@ -139,6 +139,14 @@ struct Option
return fixString(in, flags);
}
+ inline static bool hasFileExtension(const QString &str, const QStringList &extensions)
+ {
+ foreach (const QString &ext, extensions)
+ if (str.endsWith(ext))
+ return true;
+ return false;
+ }
+
//global qmake mode, can only be in one mode per invocation!
enum QMAKE_MODE { QMAKE_GENERATE_NOTHING, QMAKE_GENERATE_PROJECT, QMAKE_GENERATE_MAKEFILE,
QMAKE_GENERATE_PRL, QMAKE_SET_PROPERTY, QMAKE_QUERY_PROPERTY };
@@ -195,7 +203,6 @@ private:
inline QString fixEnvVariables(const QString &x) { return Option::fixString(x, Option::FixEnvVars); }
inline QStringList splitPathList(const QString &paths) { return paths.split(Option::dirlist_sep); }
-
// this is a stripped down version of the one found in QtCore
class QLibraryInfo
{