summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-05-16 17:50:24 -0400
committerBrad King <brad.king@kitware.com>2008-05-16 17:50:24 -0400
commit0c6ba12efd365c08334385589a4e1b5432cd6780 (patch)
treea845856cd1c04c16b52ac9b1e02ba1003e77e1da
parent10db44a81d7be2ebd93c7fb1b70883d62c421723 (diff)
downloadcmake-0c6ba12efd365c08334385589a4e1b5432cd6780.tar.gz
ENH: Teach Fortran compiler identification about the Portland Group compiler (PGI).
-rw-r--r--Modules/CMakeFortranCompilerId.F90.in2
-rw-r--r--Source/cmFileCommand.cxx14
2 files changed, 11 insertions, 5 deletions
diff --git a/Modules/CMakeFortranCompilerId.F90.in b/Modules/CMakeFortranCompilerId.F90.in
index 870c204fcf..0949b5051f 100644
--- a/Modules/CMakeFortranCompilerId.F90.in
+++ b/Modules/CMakeFortranCompilerId.F90.in
@@ -8,6 +8,8 @@ PROGRAM CMakeFortranCompilerId
PRINT *, 'INFO:compiler[GNU]'
#elif defined(__IBM__) || defined(__IBMC__)
PRINT *, 'INFO:compiler[VisualAge]'
+#elif defined(__PGI)
+ PRINT *, 'INFO:compiler[PGI]'
#elif defined(_COMPILER_VERSION)
PRINT *, 'INFO:compiler[MIPSpro]'
! This compiler is either not known or is too old to define an
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index d6c6f563f9..23272f7097 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -533,12 +533,16 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
(limit_input < 0 || static_cast<int>(fin.tellg()) < limit_input) &&
(c = fin.get(), fin))
{
- if(c == '\0')
+ if(c == '\0' || c == '\f')
{
- // A terminating null character has been found. Check if the
- // current string matches the requirements. Since it was
- // terminated by a null character, we require that the length be
- // at least one no matter what the user specified.
+ // A terminating character has been found. In most cases it is
+ // a NULL character, but at least one compiler (Portland Group
+ // Fortran) produces binaries that terminate strings with a form
+ // feed.
+
+ // Check if the current string matches the requirements. Since
+ // it was terminated by a null character, we require that the
+ // length be at least one no matter what the user specified.
if(s.length() >= minlen && s.length() >= 1 &&
(!have_regex || regex.find(s.c_str())))
{