summaryrefslogtreecommitdiff
path: root/Modules/FortranCInterface
diff options
context:
space:
mode:
authorRolf Eike Beer <eike@sf-mail.de>2014-04-06 21:30:00 +0200
committerRolf Eike Beer <eike@sf-mail.de>2014-04-14 18:16:58 +0200
commit2622bc3f65162bf6d6cb5838da6999f8b5ca75cf (patch)
treed90da340e1dd6e104f8b6c7344f6b38e4d1f03c8 /Modules/FortranCInterface
parent11a6b3d59ad2f75890fcdc42ec13c7a9ee1463f0 (diff)
downloadcmake-2622bc3f65162bf6d6cb5838da6999f8b5ca75cf.tar.gz
Clean up usage of if(... MATCHES regex) followed string(REGEX REPLACE regex)
The matches have already been calculated and can simply be taken from CMAKE_MATCH_n variables. This avoids multiple compilations of the same or very similar regular expressions.
Diffstat (limited to 'Modules/FortranCInterface')
-rw-r--r--Modules/FortranCInterface/Detect.cmake5
1 files changed, 2 insertions, 3 deletions
diff --git a/Modules/FortranCInterface/Detect.cmake b/Modules/FortranCInterface/Detect.cmake
index afeb9c588b..ceb1db4a8c 100644
--- a/Modules/FortranCInterface/Detect.cmake
+++ b/Modules/FortranCInterface/Detect.cmake
@@ -69,9 +69,8 @@ if(FortranCInterface_EXE)
file(STRINGS "${FortranCInterface_EXE}" _info_strings
LIMIT_COUNT 8 REGEX "INFO:[^[]*\\[")
foreach(info ${_info_strings})
- if("${info}" MATCHES ".*INFO:symbol\\[([^]]*)\\].*")
- string(REGEX REPLACE ".*INFO:symbol\\[([^]]*)\\].*" "\\1" symbol "${info}")
- list(APPEND FortranCInterface_SYMBOLS ${symbol})
+ if("${info}" MATCHES "INFO:symbol\\[([^]]*)\\]")
+ list(APPEND FortranCInterface_SYMBOLS ${CMAKE_MATCH_1})
endif()
endforeach()
elseif(NOT _result)