From 0c6ba12efd365c08334385589a4e1b5432cd6780 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 16 May 2008 17:50:24 -0400 Subject: [PATCH] ENH: Teach Fortran compiler identification about the Portland Group compiler (PGI). --- Modules/CMakeFortranCompilerId.F90.in | 2 ++ Source/cmFileCommand.cxx | 14 +++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Modules/CMakeFortranCompilerId.F90.in b/Modules/CMakeFortranCompilerId.F90.in index 870c204fc..0949b5051 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 d6c6f563f..23272f709 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -533,12 +533,16 @@ bool cmFileCommand::HandleStringsCommand(std::vector const& args) (limit_input < 0 || static_cast(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()))) {