summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-09-01 14:52:51 (GMT)
committerBrad King <brad.king@kitware.com>2011-09-01 14:54:12 (GMT)
commit90efed6ee60fde3a1211672854f7e23affa8b983 (patch)
tree727b3529a608d9b7ea4d8650aab20c6b8a1f5bd1
parent5c0c635a0947aa44a0e3edf65b73c61d9abced2d (diff)
downloadCMake-90efed6ee60fde3a1211672854f7e23affa8b983.zip
CMake-90efed6ee60fde3a1211672854f7e23affa8b983.tar.gz
CMake-90efed6ee60fde3a1211672854f7e23affa8b983.tar.bz2
Xcode: Honor Fortran_FORMAT target and source file property
Convert the target property to the IFORT_LANG_SRCFMT build setting. Convert the source property to the per-source COMPILER_FLAGS setting.
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index f67b029..2821827 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -582,6 +582,13 @@ cmGlobalXCodeGenerator::CreateXCodeSourceFile(cmLocalGenerator* lg,
{
lg->AppendFlags(flags, cmtarget.GetProperty("COMPILE_FLAGS"));
}
+ const char* srcfmt = sf->GetProperty("Fortran_FORMAT");
+ switch(this->CurrentLocalGenerator->GetFortranFormat(srcfmt))
+ {
+ case cmLocalGenerator::FortranFormatFixed: flags="-fixed "+flags; break;
+ case cmLocalGenerator::FortranFormatFree: flags="-free "+flags; break;
+ default: break;
+ }
lg->AppendFlags(flags, sf->GetProperty("COMPILE_FLAGS"));
// Add per-source definitions.
@@ -1903,6 +1910,21 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
this->CreateString(flags.c_str()));
}
+ // Add Fortran source format attribute if property is set.
+ const char* format = 0;
+ const char* tgtfmt = target.GetProperty("Fortran_FORMAT");
+ switch(this->CurrentLocalGenerator->GetFortranFormat(tgtfmt))
+ {
+ case cmLocalGenerator::FortranFormatFixed: format = "fixed"; break;
+ case cmLocalGenerator::FortranFormatFree: format = "free"; break;
+ default: break;
+ }
+ if(format)
+ {
+ buildSettings->AddAttribute("IFORT_LANG_SRCFMT",
+ this->CreateString(format));
+ }
+
// Create the INSTALL_PATH attribute.
std::string install_name_dir;
if(target.GetType() == cmTarget::SHARED_LIBRARY)