VS: Support Intel Fortran 15 .vfproj generation (#15175)

This version of the Intel Fortran plugin to Visual Studio says:

 please make sure that $(OutDir), $(TargetName) and $(TargetExt)
 property values match the value specified in %(Link.OutputFile)

We must set TargetName and TargetExt in addition to the existing
setting for OutputDirectory.  The settings do not appear to hurt
older versions of Intel Fortran, so set them unconditionally.

Extend the FortranOnly test to cover a corresponding use case by
using the OUTPUT_NAME target property.

Inspired-by: Ian Harvey <Ian.Harvey@megms.com.au>
This commit is contained in:
Brad King
2014-09-29 10:12:43 -04:00
parent a22570ea19
commit a128129a86
2 changed files with 23 additions and 8 deletions

View File

@@ -796,6 +796,20 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
<< "\t\t\tUseOfMFC=\"" << mfcFlag << "\"\n"
<< "\t\t\tATLMinimizesCRunTimeLibraryUsage=\"false\"\n";
if (this->FortranProject)
{
// Intel Fortran >= 15.0 uses TargetName property.
std::string targetNameFull = target.GetFullName(configName);
std::string targetName =
cmSystemTools::GetFilenameWithoutLastExtension(targetNameFull);
std::string targetExt =
cmSystemTools::GetFilenameLastExtension(targetNameFull);
fout <<
"\t\t\tTargetName=\"" << this->EscapeForXML(targetName) << "\"\n"
"\t\t\tTargetExt=\"" << this->EscapeForXML(targetExt) << "\"\n"
;
}
// If unicode is enabled change the character set to unicode, if not
// then default to MBCS.
if(targetOptions.UsingUnicode())