Commit a9d7024f authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[ADD] - extended FindOpenCL script to search for cl.hpp too.

parent 28d1c038
This diff is collapsed.
# This script searches cl.h and cl.hpp (the C++ binding header). Grab these headers form http://www.khronos.org/registry/cl.
#
# The following variables will be filled:
# * OPENCL_FOUND - if cl.h, cl.hpp and OpenCL lib was found
# * OPENCL_INCLUDE_DIR - the path of cl.h if found
# * OPENCL_CPP_INCLUDE_DIR - the path of cl.hpp if found
# * OPENCL_LIBRARY - the path to the OpenCL library
#
FIND_PATH( OPENCL_INCLUDE_DIR CL/cl.h /usr/include /usr/local/include )
FIND_PATH( OPENCL_CPP_INCLUDE_DIR CL/cl.hpp /usr/include /usr/local/include )
FIND_LIBRARY( OPENCL_LIBRARY NAMES OpenCL PATH /usr/lib /usr/local/lib /usr/local/cuda/lib64 /usr/local/cuda/lib )
message( STATUS ${OPENCL_CPP_INCLUDE_DIR} )
SET( OPENCL_FOUND FALSE )
IF ( OPENCL_INCLUDE_DIR AND OPENCL_LIBRARY )
SET( OPENCL_FOUND TRUE )
ENDIF ( OPENCL_INCLUDE_DIR AND OPENCL_LIBRARY )
IF ( OPENCL_INCLUDE_DIR AND OPENCL_CPP_INCLUDE_DIR AND OPENCL_LIBRARY )
SET( OPENCL_FOUND TRUE )
ENDIF ( OPENCL_INCLUDE_DIR AND OPENCL_CPP_INCLUDE_DIR AND OPENCL_LIBRARY )
IF ( OPENCL_FOUND )
IF ( NOT OPENCL_FIND_QUIETLY )
MESSAGE( STATUS "Found OpenCL: ${OPENCL_LIBRARY} and include in ${OPENCL_INCLUDE_DIR}" )
MESSAGE( STATUS "Found OpenCL: ${OPENCL_LIBRARY} and include in ${OPENCL_INCLUDE_DIR}" )
ENDIF ( NOT OPENCL_FIND_QUIETLY )
ELSE ( OPENCL_FOUND )
IF (OPENCL_FIND_REQUIRED)
MESSAGE( FATAL_ERROR "Could not find OpenCL" )
MESSAGE( FATAL_ERROR "Could not find OpenCL. Install an up-to-date graphics driver and grab the OpenCL headers from http://www.khronos.org/registry/cl." )
ENDIF ( OPENCL_FIND_REQUIRED )
ENDIF ( OPENCL_FOUND )
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment