summaryrefslogtreecommitdiffstats
path: root/Modules/FindBISON.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-04-15 14:22:34 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-04-15 14:22:34 (GMT)
commit18aaed77c0eb4ea81e02ece5d0be0525e4460828 (patch)
treeb9edac325fd6d09118b15aca5d8b2d82a1f76ab1 /Modules/FindBISON.cmake
parent60d1882a67a550c0fbe11e2462669830c89ee89e (diff)
parentf21ac16edd0d2fbe78daf17bf5f964e4cfbd694b (diff)
downloadCMake-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/FindBISON.cmake')
-rw-r--r--Modules/FindBISON.cmake15
1 files changed, 6 insertions, 9 deletions
diff --git a/Modules/FindBISON.cmake b/Modules/FindBISON.cmake
index 9ca428e..ec3ee78 100644
--- a/Modules/FindBISON.cmake
+++ b/Modules/FindBISON.cmake
@@ -92,16 +92,13 @@ if(BISON_EXECUTABLE)
message(SEND_ERROR "Command \"${BISON_EXECUTABLE} --version\" failed with output:\n${BISON_version_error}")
else()
# Bison++
- if("${BISON_version_output}" MATCHES "^bison\\+\\+")
- string(REGEX REPLACE "^bison\\+\\+ Version ([^,]+).*" "\\1"
- BISON_VERSION "${BISON_version_output}")
+ if("${BISON_version_output}" MATCHES "^bison\\+\\+ Version ([^,]+)")
+ set(BISON_VERSION "${CMAKE_MATCH_1}")
# GNU Bison
- elseif("${BISON_version_output}" MATCHES "^bison[^+]")
- string(REGEX REPLACE "^bison \\(GNU Bison\\) ([^\n]+)\n.*" "\\1"
- BISON_VERSION "${BISON_version_output}")
- elseif("${BISON_version_output}" MATCHES "^GNU Bison ")
- string(REGEX REPLACE "^GNU Bison (version )?([^\n]+).*" "\\2"
- BISON_VERSION "${BISON_version_output}")
+ elseif("${BISON_version_output}" MATCHES "^bison \\(GNU Bison\\) ([^\n]+)\n")
+ set(BISON_VERSION "${CMAKE_MATCH_1}")
+ elseif("${BISON_version_output}" MATCHES "^GNU Bison (version )?([^\n]+)")
+ set(BISON_VERSION "${CMAKE_MATCH_2}")
endif()
endif()