mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-02 03:39:43 -06:00
FindOpenCL: Fix version detection in presence of multiple versions
Previously our call to `check_symbol_exists` was passing an absolute path to the `cl.h` header to be included. However, this might not include its other headers correctly. We already set `CMAKE_REQUIRED_INCLUDES` such that `CL/cl.h` can be included by the check, so we do not need to include by absolute path.
This commit is contained in:
@@ -53,12 +53,12 @@ function(_FIND_OPENCL_VERSION)
|
||||
if(EXISTS ${OpenCL_INCLUDE_DIR}/Headers/cl.h)
|
||||
check_symbol_exists(
|
||||
CL_VERSION_${VERSION}
|
||||
"${OpenCL_INCLUDE_DIR}/Headers/cl.h"
|
||||
"Headers/cl.h"
|
||||
OPENCL_VERSION_${VERSION})
|
||||
else()
|
||||
check_symbol_exists(
|
||||
CL_VERSION_${VERSION}
|
||||
"${OpenCL_INCLUDE_DIR}/CL/cl.h"
|
||||
"CL/cl.h"
|
||||
OPENCL_VERSION_${VERSION})
|
||||
endif()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user