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>
This commit is contained in:
parent
aa2ba12164
commit
fa8b30ebb5
|
@ -669,8 +669,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
|
||||||
static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator);
|
static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator);
|
||||||
fout << "\t\t<Configuration\n"
|
fout << "\t\t<Configuration\n"
|
||||||
<< "\t\t\tName=\"" << configName
|
<< "\t\t\tName=\"" << configName
|
||||||
<< "|" << gg->GetPlatformName() << "\"\n"
|
<< "|" << gg->GetPlatformName() << "\"\n";
|
||||||
<< "\t\t\tOutputDirectory=\"" << configName << "\"\n";
|
|
||||||
// This is an internal type to Visual Studio, it seems that:
|
// This is an internal type to Visual Studio, it seems that:
|
||||||
// 4 == static library
|
// 4 == static library
|
||||||
// 2 == dll
|
// 2 == dll
|
||||||
|
@ -798,6 +797,16 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
|
||||||
std::string intermediateDir = this->GetTargetDirectory(target);
|
std::string intermediateDir = this->GetTargetDirectory(target);
|
||||||
intermediateDir += "/";
|
intermediateDir += "/";
|
||||||
intermediateDir += configName;
|
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=\""
|
fout << "\t\t\tIntermediateDirectory=\""
|
||||||
<< this->ConvertToXMLOutputPath(intermediateDir.c_str())
|
<< this->ConvertToXMLOutputPath(intermediateDir.c_str())
|
||||||
<< "\"\n"
|
<< "\"\n"
|
||||||
|
|
Loading…
Reference in New Issue