From fa8b30ebb57da8ddc3e3616c4d212811abc19335 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 16 Feb 2015 11:13:43 -0500 Subject: 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 --- Source/cmLocalVisualStudio7Generator.cxx | 13 +++++++++++-- 1 file 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(this->GlobalGenerator); fout << "\t\tGetPlatformName() << "\"\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" -- cgit v0.12