diff options
Diffstat (limited to 'qmake/generators/win32/msvc_vcproj.cpp')
-rw-r--r-- | qmake/generators/win32/msvc_vcproj.cpp | 69 |
1 files changed, 16 insertions, 53 deletions
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 |