Fixed cmake/FindOpenCL.cmake version parsing

Current versions of the OpenCL headers define several version macros
and we want to make sure to parse just the main version macro.

This is a simple near-term fix, since we'd like to move to the standard
CMake FindOpenCL module and delete this custom module.
This commit is contained in:
David G Yu 2023-09-07 16:58:43 -07:00
parent 18f3b91c28
commit 92442439f5

View File

@ -177,7 +177,7 @@ if(_OPENCL_CPP_INCLUDE_DIRS)
if(EXISTS "${OPENCL_INCLUDE_DIRS}/CL/cl.h")
file(STRINGS "${OPENCL_INCLUDE_DIRS}/CL/cl.h" LINES REGEX "^#define CL_VERSION_.*$")
file(STRINGS "${OPENCL_INCLUDE_DIRS}/CL/cl.h" LINES REGEX "^#define CL_VERSION_[0-9]_[0-9]")
foreach(LINE ${LINES})