From 736f0a0dd113e54a4d49a1e1e992dc42070866b5 Mon Sep 17 00:00:00 2001 From: Martin Petersson Date: Fri, 30 Apr 2010 15:34:26 +0200 Subject: Fix project file generation for MSVC 2010 Adding the post-build step to copy the dll into bin Reviewed-By: Thierry --- qmake/generators/win32/msbuild_objectmodel.cpp | 24 ++++++++++++++++++++++++ qmake/generators/win32/msvc_vcxproj.cpp | 11 ++++++++--- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index d011c5c..522d517 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -2837,6 +2837,18 @@ XmlOutput &operator<<(XmlOutput &xml, const VCXProjectSingleConfig &tool) // ResourceCompiler xml << tool.Configuration.resource; + // Post build event + if ( tool.Configuration.postBuild.UseInBuild != unset ) + xml << tool.Configuration.postBuild; + + // Pre build event + if ( tool.Configuration.preBuild.UseInBuild != unset ) + xml << tool.Configuration.preBuild; + + // Pre link event + if ( tool.Configuration.preLink.UseInBuild != unset ) + xml << tool.Configuration.preLink; + xml << closetag(); QFile filterFile; @@ -3266,6 +3278,18 @@ XmlOutput &operator<<(XmlOutput &xml, VCXProject &tool) // ResourceCompiler xml << tool.SingleProjects.at(i).Configuration.resource; + // Post build event + if ( tool.SingleProjects.at(i).Configuration.postBuild.UseInBuild != unset ) + xml << tool.SingleProjects.at(i).Configuration.postBuild; + + // Pre build event + if ( tool.SingleProjects.at(i).Configuration.preBuild.UseInBuild != unset ) + xml << tool.SingleProjects.at(i).Configuration.preBuild; + + // Pre link event + if ( tool.SingleProjects.at(i).Configuration.preLink.UseInBuild != unset ) + xml << tool.SingleProjects.at(i).Configuration.preLink; + xml << closetag(); } diff --git a/qmake/generators/win32/msvc_vcxproj.cpp b/qmake/generators/win32/msvc_vcxproj.cpp index 76aa2a9..da93fe3 100644 --- a/qmake/generators/win32/msvc_vcxproj.cpp +++ b/qmake/generators/win32/msvc_vcxproj.cpp @@ -384,20 +384,24 @@ void VcxprojGenerator::initPostBuildEventTools() QString cmdline = var("QMAKE_POST_LINK"); conf.postBuild.CommandLine = cmdline; conf.postBuild.Description = cmdline; + conf.postBuild.UseInBuild = _True; } 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) - conf.postBuild.CommandLine.prepend(QLatin1String("signtool sign /F ") + signature + " \"$(TargetPath)\"\n" + - (!conf.postBuild.CommandLine.isEmpty() ? " && " : "")); + if(useSignature) { + conf.postBuild.CommandLine.prepend(QLatin1String("signtool sign /F ") + signature + " \"$(TargetPath)\"\n" + + (!conf.postBuild.CommandLine.isEmpty() ? " && " : "")); + conf.postBuild.UseInBuild = _True; + } if(!project->values("MSVCPROJ_COPY_DLL").isEmpty()) { if(!conf.postBuild.CommandLine.isEmpty()) conf.postBuild.CommandLine += " && "; conf.postBuild.Description += var("MSVCPROJ_COPY_DLL_DESC"); conf.postBuild.CommandLine += var("MSVCPROJ_COPY_DLL"); + conf.postBuild.UseInBuild = _True; } } @@ -530,6 +534,7 @@ void VcxprojGenerator::initPreLinkEventTools() QString cmdline = var("QMAKE_PRE_LINK"); conf.preLink.Description = cmdline; conf.preLink.CommandLine = cmdline; + conf.preLink.UseInBuild = _True; } } -- cgit v0.12