summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
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.cpp16
-rw-r--r--qmake/generators/win32/msvc_objectmodel.h1
-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
-rw-r--r--qmake/project.cpp1
12 files changed, 64 insertions, 74 deletions
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index 0ec946e..19667cd 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 f94a63f..0fdef86 100644
--- a/qmake/generators/symbian/symmake_sbsv2.cpp
+++ b/qmake/generators/symbian/symmake_sbsv2.cpp
@@ -727,7 +727,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 5ea13f4..212f8bd 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 2639332..462920e 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 1b2cd18..c55806d 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 69cfc0d..815a476 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -355,7 +355,7 @@ VCCLCompilerTool::VCCLCompilerTool()
TreatWChar_tAsBuiltInType(unset),
TurnOffAssemblyGeneration(unset),
UndefineAllPreprocessorDefinitions(unset),
- UsePrecompiledHeader(pchNone),
+ UsePrecompiledHeader(pchUnset),
UseUnicodeForAssemblerListing(unset),
WarnAsError(unset),
WarningLevel(warningLevel_0),
@@ -389,7 +389,7 @@ inline XmlOutput::xml_output xformUsePrecompiledHeaderForNET2005(pchOption whatP
if (whatPch == pchGenerateAuto) whatPch = (pchOption)0;
if (whatPch == pchUseUsingSpecific) whatPch = (pchOption)2;
}
- return attrE(_UsePrecompiledHeader, whatPch);
+ return attrE(_UsePrecompiledHeader, whatPch, /*ifNot*/ pchUnset);
}
inline XmlOutput::xml_output xformExceptionHandlingNET2005(exceptionHandling eh, DotNET compilerVersion)
@@ -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)
@@ -2146,7 +2146,7 @@ void VCFilter::modifyPCHstage(QString str)
useCompilerTool = true;
// Setup PCH options
CompilerTool.UsePrecompiledHeader = (isCFile ? pchNone : pchCreateUsingSpecific);
- CompilerTool.PrecompiledHeaderThrough = (isCPPFile ? QString("$(INHERIT)") : QString("$(NOINHERIT)"));
+ CompilerTool.PrecompiledHeaderThrough = (isCPPFile ? Project->precompHFilename : QString("$(NOINHERIT)"));
CompilerTool.ForcedIncludeFiles = QStringList("$(NOINHERIT)");
}
@@ -2514,7 +2514,7 @@ void VCProjectWriter::write(XmlOutput &xml, const VCCLCompilerTool &tool)
<< attrT(_TurnOffAssemblyGeneration, tool.TurnOffAssemblyGeneration)
<< attrT(_UndefineAllPreprocessorDefinitions, tool.UndefineAllPreprocessorDefinitions)
<< attrX(_UndefinePreprocessorDefinitions, tool.UndefinePreprocessorDefinitions)
- << (!tool.PrecompiledHeaderFile.isEmpty() || !tool.PrecompiledHeaderThrough.isEmpty() ? xformUsePrecompiledHeaderForNET2005(tool.UsePrecompiledHeader, tool.config->CompilerVersion) : noxml())
+ << xformUsePrecompiledHeaderForNET2005(tool.UsePrecompiledHeader, tool.config->CompilerVersion)
<< attrT(_WarnAsError, tool.WarnAsError)
<< attrE(_WarningLevel, tool.WarningLevel, /*ifNot*/ warningLevelUnknown)
<< attrT(_WholeProgramOptimization, tool.WholeProgramOptimization)
diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h
index 5431ce0..3e62fb4 100644
--- a/qmake/generators/win32/msvc_objectmodel.h
+++ b/qmake/generators/win32/msvc_objectmodel.h
@@ -366,6 +366,7 @@ enum optLinkTimeCodeGenType {
optLTCGUpdate
};
enum pchOption {
+ pchUnset = -1,
pchNone,
pchCreateUsingSpecific,
pchGenerateAuto,
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index 0df33d0..80f5bde 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 656afa9..fdcd73f 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 c85533b..ef234ec 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 e3ddc9a..bc87343 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
{
diff --git a/qmake/project.cpp b/qmake/project.cpp
index 7cc1cb6..815f210 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -1651,7 +1651,6 @@ QMakeProject::doProjectInclude(QString file, uchar flags, QMap<QString, QStringL
if(file.indexOf(Option::dir_sep) == -1 || !QFile::exists(file)) {
static QStringList *feature_roots = 0;
if(!feature_roots) {
- validateModes();
feature_roots = new QStringList(qmake_feature_paths(prop));
qmakeAddCacheClear(qmakeDeleteCacheClear<QStringList>, (void**)&feature_roots);
}