summaryrefslogtreecommitdiffstats
path: root/Source/cmCommonTargetGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmCommonTargetGenerator.cxx')
-rw-r--r--Source/cmCommonTargetGenerator.cxx30
1 files changed, 30 insertions, 0 deletions
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index cbcf682..c691fa4 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -15,6 +15,7 @@
#include "cmGlobalCommonGenerator.h"
#include "cmLocalCommonGenerator.h"
#include "cmMakefile.h"
+#include "cmSourceFile.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
@@ -192,3 +193,32 @@ void cmCommonTargetGenerator::AddFortranFlags(std::string& flags)
}
}
}
+
+//----------------------------------------------------------------------------
+void
+cmCommonTargetGenerator
+::AppendFortranFormatFlags(std::string& flags, cmSourceFile const& source)
+{
+ const char* srcfmt = source.GetProperty("Fortran_FORMAT");
+ cmLocalGenerator::FortranFormat format =
+ this->LocalGenerator->GetFortranFormat(srcfmt);
+ if(format == cmLocalGenerator::FortranFormatNone)
+ {
+ const char* tgtfmt = this->Target->GetProperty("Fortran_FORMAT");
+ format = this->LocalGenerator->GetFortranFormat(tgtfmt);
+ }
+ const char* var = 0;
+ switch (format)
+ {
+ case cmLocalGenerator::FortranFormatFixed:
+ var = "CMAKE_Fortran_FORMAT_FIXED_FLAG"; break;
+ case cmLocalGenerator::FortranFormatFree:
+ var = "CMAKE_Fortran_FORMAT_FREE_FLAG"; break;
+ default: break;
+ }
+ if(var)
+ {
+ this->LocalGenerator->AppendFlags(
+ flags, this->Makefile->GetDefinition(var));
+ }
+}