diff options
author | Brad King <brad.king@kitware.com> | 2014-04-15 14:22:34 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-04-15 14:22:34 (GMT) |
commit | 18aaed77c0eb4ea81e02ece5d0be0525e4460828 (patch) | |
tree | b9edac325fd6d09118b15aca5d8b2d82a1f76ab1 /Modules/FindPerl.cmake | |
parent | 60d1882a67a550c0fbe11e2462669830c89ee89e (diff) | |
parent | f21ac16edd0d2fbe78daf17bf5f964e4cfbd694b (diff) | |
download | CMake-18aaed77c0eb4ea81e02ece5d0be0525e4460828.zip CMake-18aaed77c0eb4ea81e02ece5d0be0525e4460828.tar.gz CMake-18aaed77c0eb4ea81e02ece5d0be0525e4460828.tar.bz2 |
Merge topic 'matches-cleanup'
f21ac16e Replace MATCHES test on numbers with EQUAL test
7eacbaed Replace MATCHES ".+" tests with NOT STREQUAL ""
3a71d34c Use CMAKE_SYSTEM_NAME instead of CMAKE_SYSTEM where sufficient
b0b4b460 Remove .* expressions from beginning and end of MATCHES regexs
5bd48ac5 Replace string(REGEX REPLACE) with string(REPLACE) where possible
2622bc3f Clean up usage of if(... MATCHES regex) followed string(REGEX REPLACE regex)
Diffstat (limited to 'Modules/FindPerl.cmake')
-rw-r--r-- | Modules/FindPerl.cmake | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/FindPerl.cmake b/Modules/FindPerl.cmake index 3fd5d8e..70284b6 100644 --- a/Modules/FindPerl.cmake +++ b/Modules/FindPerl.cmake @@ -70,9 +70,9 @@ if(PERL_EXECUTABLE) OUTPUT_STRIP_TRAILING_WHITESPACE ) if(NOT PERL_VERSION_RESULT_VARIABLE AND PERL_VERSION_OUTPUT_VARIABLE MATCHES "This is perl.*[ \\(]v([0-9\\._]+)[ \\)]") - string(REGEX REPLACE ".*This is perl.*[ \\(]v([0-9\\._]+)[ \\)].*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE}) + set(PERL_VERSION_STRING "${CMAKE_MATCH_1}") elseif(NOT PERL_VERSION_RESULT_VARIABLE AND PERL_VERSION_OUTPUT_VARIABLE MATCHES "This is perl, version ([0-9\\._]+) +") - string(REGEX REPLACE ".*This is perl, version ([0-9\\._]+) +.*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE}) + set(PERL_VERSION_STRING "${CMAKE_MATCH_1}") endif() endif() endif() |