Skip to content

Commit

Permalink
FindANTLR: Fix version RegEx
Browse files Browse the repository at this point in the history
The currently used RegEx only allowed for single-digit version components for
everything but the major version. Thus, when parsing e.g. the version 4.10.1,
only the part 4.1 would be matched and thus, the determined ANTLR version
would be wrong.

Signed-off-by: Robert Adam <[email protected]>
  • Loading branch information
Krzmbrzl authored and parrt committed Jun 25, 2022
1 parent 0247965 commit 419ab11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion runtime/Cpp/cmake/FindANTLR.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if(ANTLR_EXECUTABLE AND Java_JAVA_EXECUTABLE)
OUTPUT_STRIP_TRAILING_WHITESPACE)

if(ANTLR_COMMAND_RESULT EQUAL 0)
string(REGEX MATCH "Version [0-9]+(\\.[0-9])*" ANTLR_VERSION ${ANTLR_COMMAND_OUTPUT})
string(REGEX MATCH "Version [0-9]+(\\.[0-9]+)*" ANTLR_VERSION ${ANTLR_COMMAND_OUTPUT})
string(REPLACE "Version " "" ANTLR_VERSION ${ANTLR_VERSION})
else()
message(
Expand Down

0 comments on commit 419ab11

Please sign in to comment.