Skip to content

Commit

Permalink
Findthrust.cmake: Fix the bug in regular replacement.
Browse files Browse the repository at this point in the history
Fix bug #407: The original regular replacement does not consider the possibility that THRUST_VERSION may be followed by comments.
  • Loading branch information
HWZen authored and stotko committed Mar 13, 2024
1 parent 71a5aef commit 1f0b2d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmake/Findthrust.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if(THRUST_INCLUDE_DIR)
THRUST_VERSION_STRING
REGEX "#define THRUST_VERSION[ \t]+([0-9x]+)")

string(REGEX REPLACE "#define THRUST_VERSION[ \t]+" "" THRUST_VERSION_STRING ${THRUST_VERSION_STRING})
string(REGEX REPLACE "#define THRUST_VERSION[ \t]+([0-9]+).*" "\\1" THRUST_VERSION_STRING ${THRUST_VERSION_STRING})

math(EXPR THRUST_VERSION_MAJOR "${THRUST_VERSION_STRING} / 100000")
math(EXPR THRUST_VERSION_MINOR "(${THRUST_VERSION_STRING} / 100) % 1000")
Expand Down

0 comments on commit 1f0b2d5

Please sign in to comment.