summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-10-23 15:33:27 (GMT)
committerBrad King <brad.king@kitware.com>2009-10-23 15:33:27 (GMT)
commitd4377c33777fe523edd3b9744a85c360feba5fa0 (patch)
tree84543e614035e585abcf6377ab8952fef4ecd9b0
parent83816cc6ec619f3c108734814837510e31370e99 (diff)
downloadCMake-d4377c33777fe523edd3b9744a85c360feba5fa0.zip
CMake-d4377c33777fe523edd3b9744a85c360feba5fa0.tar.gz
CMake-d4377c33777fe523edd3b9744a85c360feba5fa0.tar.bz2
Always set OutputPath in VS 10 projects
The default $(OutDir)$(TargetName)$(TargetExt) for this value works in most cases because we set the three properties. However, if the target property PREFIX contains a path component (not documented but happens to work in other VS generators) we drop it from TargetName and do not put it in OutDir either. This commit corrects the resulting path by setting the OutputPath property explicitly with the full path. See issue #9768.
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 860fe21..154fe6c 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1133,13 +1133,18 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const&
targetNameImport, targetNamePDB,
config.c_str());
}
- std::string imLib = this->Target->GetDirectory(config.c_str(), true);
- std::string dir = this->Target->GetDirectory(config.c_str(), true);
+
+ std::string dir = this->Target->GetDirectory(config.c_str());
dir += "/";
- imLib += "/";
- imLib += targetNameImport;
+ std::string out = dir;
+ out += targetNameFull;
std::string pdb = dir;
pdb += targetNamePDB;
+ std::string imLib = this->Target->GetDirectory(config.c_str(), true);
+ imLib += "/";
+ imLib += targetNameImport;
+
+ linkOptions.AddFlag("OutputFile", out.c_str());
linkOptions.AddFlag("ImportLibrary", imLib.c_str());
linkOptions.AddFlag("ProgramDataBaseFileName", pdb.c_str());
linkOptions.Parse(flags.c_str());