diff --git a/cmake/Findthrust.cmake b/cmake/Findthrust.cmake index 2837f84e6..70399fb97 100644 --- a/cmake/Findthrust.cmake +++ b/cmake/Findthrust.cmake @@ -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")