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.
  • Loading branch information
Krzmbrzl authored May 9, 2022
1 parent f25a4f6 commit 1d3d476
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 1d3d476

Please sign in to comment.