From 7a411dfbf6d9987869fd39e57f38f6a9c3d548aa Mon Sep 17 00:00:00 2001 From: Christian Pfeiffer Date: Tue, 28 Mar 2017 11:51:35 +0200 Subject: VS: Fix OBJECT library support in Intel Fortran projects The `TargetExt` for `.vfproj` object libraries should be `.lib` to match the `OutputFile` value. Otherwise Visual Fortran raises warnings: TargetPath(...) does not match the Library's OutputFile property value (...) --- Source/cmLocalVisualStudio7Generator.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 7c33821..3117ef3 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -746,11 +746,13 @@ void cmLocalVisualStudio7Generator::WriteConfiguration( if (this->FortranProject) { // Intel Fortran >= 15.0 uses TargetName property. - std::string targetNameFull = target->GetFullName(configName); - std::string targetName = + std::string const targetNameFull = target->GetFullName(configName); + std::string const targetName = cmSystemTools::GetFilenameWithoutLastExtension(targetNameFull); - std::string targetExt = - cmSystemTools::GetFilenameLastExtension(targetNameFull); + std::string const targetExt = + target->GetType() == cmStateEnums::OBJECT_LIBRARY + ? ".lib" + : cmSystemTools::GetFilenameLastExtension(targetNameFull); /* clang-format off */ fout << "\t\t\tTargetName=\"" << this->EscapeForXML(targetName) << "\"\n" -- cgit v0.12