Added in version 3.1.
Finds Open Computing Language (OpenCL).
Added in version 3.10: Detection of OpenCL 2.1 and 2.2.
Added in version 3.7.
This module provides the following Imported Targets, if OpenCL has been found:
OpenCL::OpenCLTarget providing OpenCL usage requirements.
This module defines the following variables:
OpenCL_FOUNDTrue if OpenCL was found.
OpenCL_INCLUDE_DIRSInclude directories needed to use OpenCL.
OpenCL_LIBRARIESLibraries needed to link to OpenCL.
OpenCL_VERSION_STRINGHighest supported OpenCL version (e.g., 1.2).
OpenCL_VERSION_MAJORThe major version of the OpenCL implementation.
OpenCL_VERSION_MINORThe minor version of the OpenCL implementation.
The following cache variables may also be set:
OpenCL_INCLUDE_DIRThe OpenCL include directory.
OpenCL_LIBRARYThe path to the OpenCL library.
Finding OpenCL and linking it to a project target:
find_package(OpenCL)
target_link_libraries(project_target PRIVATE OpenCL::OpenCL)