summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-02-16 16:13:43 (GMT)
committerBrad King <brad.king@kitware.com>2015-02-16 16:48:16 (GMT)
commitfa8b30ebb57da8ddc3e3616c4d212811abc19335 (patch)
treee3904002df78279e6b19c662eb7130d0c2725cb3 /Source
parentaa2ba12164046cd1812c3f3b67cadca856d51846 (diff)
downloadCMake-fa8b30ebb57da8ddc3e3616c4d212811abc19335.zip
CMake-fa8b30ebb57da8ddc3e3616c4d212811abc19335.tar.gz
CMake-fa8b30ebb57da8ddc3e3616c4d212811abc19335.tar.bz2
VS: Fix .vcproj and .vfproj file OutputDirectory generation
Teach cmLocalVisualStudio7Generator to set 'OutputDirectory' using the same method as is used to set the 'OutputFile' in the generated project file. Also, OutputDirectory only needs to be set for targets that run the linker or librarian. These two changes make the VS 7 OutputDirectory consistent with what cmVisualStudio10TargetGenerator generates for OutDir. Without this, since the VS Intel Fortran plugin for VS >= 10 still uses the VS 7 .vfproj file format, when executing test VSGNUFortran using Intel Fortran Compiler 15.xx, the following warning is issued just before compilation: TargetPath(...) does not match the Linker's OutputFile property value (...). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile). Subsequently, an error is reported during linking. Inspired-by: Vincent Newsum <vynewsum@gmail.com>
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 88c5284..ed560aa 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -669,8 +669,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator);
fout << "\t\t<Configuration\n"
<< "\t\t\tName=\"" << configName
- << "|" << gg->GetPlatformName() << "\"\n"
- << "\t\t\tOutputDirectory=\"" << configName << "\"\n";
+ << "|" << gg->GetPlatformName() << "\"\n";
// This is an internal type to Visual Studio, it seems that:
// 4 == static library
// 2 == dll
@@ -798,6 +797,16 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
std::string intermediateDir = this->GetTargetDirectory(target);
intermediateDir += "/";
intermediateDir += configName;
+
+ if (target.GetType() < cmTarget::UTILITY)
+ {
+ std::string const& outDir =
+ target.GetType() == cmTarget::OBJECT_LIBRARY?
+ intermediateDir : target.GetDirectory(configName);
+ fout << "\t\t\tOutputDirectory=\""
+ << this->ConvertToXMLOutputPathSingle(outDir.c_str()) << "\"\n";
+ }
+
fout << "\t\t\tIntermediateDirectory=\""
<< this->ConvertToXMLOutputPath(intermediateDir.c_str())
<< "\"\n"