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

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

parent 28d1c038
......@@ -152,13 +152,17 @@ IF( EIGEN3_FOUND )
ENDIF()
### OPENCL ###
FIND_PACKAGE( OpenCL QUIET )
IF( OPENCL_FOUND )
OPTION( OW_USE_OPENCL "Enable OpenCL if available." )
IF( OW_USE_OPENCL )
FIND_PACKAGE( OpenCL QUIET )
IF( OPENCL_FOUND )
INCLUDE_DIRECTORIES( ${OPENCL_INCLUDE_DIR} )
INCLUDE_DIRECTORIES( ${OPENCL_CPP_INCLUDE_DIR} )
LINK_LIBRARIES( ${OPENCL_LIBRARY} )
MARK_AS_ADVANCED( OPENCL_INCLUDE_DIR )
MARK_AS_ADVANCED( OPENCL_LIBRARY )
ENDIF()
ENDIF()
ENDIF( OW_USE_OPENCL )
### CUDA #### (e.g. for the detTractClustering module )
OPTION( OW_USE_CUDA "Enable CUDA if available. Minimum version required is 2.3" )
......
# 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 )
IF ( OPENCL_INCLUDE_DIR AND OPENCL_CPP_INCLUDE_DIR AND OPENCL_LIBRARY )
SET( OPENCL_FOUND TRUE )
ENDIF ( OPENCL_INCLUDE_DIR AND OPENCL_LIBRARY )
ENDIF ( OPENCL_INCLUDE_DIR AND OPENCL_CPP_INCLUDE_DIR AND OPENCL_LIBRARY )
IF ( OPENCL_FOUND )
IF ( NOT OPENCL_FIND_QUIETLY )
......@@ -12,6 +24,7 @@ IF ( OPENCL_FOUND )
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