Commit 6ae76313 authored by Joseph Noir's avatar Joseph Noir

Move FindOPENCL.cmake to the cmake folder

Moving the file requires the adjustment of the
CMAKE_MODULE_PATH. Since, cmake seems to prefer
its own FindOpenCL, ours is adjusted to use the
same variables for library and include paths.
(cmake does not ship the find scripts on all
platforms)
parent 34d6c318
...@@ -57,7 +57,7 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") ...@@ -57,7 +57,7 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
"initialize the build configuration.") "initialize the build configuration.")
endif() endif()
# set module path appropriately # set module path appropriately
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}") set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# set binary output path if not defined by user # set binary output path if not defined by user
if("${EXECUTABLE_OUTPUT_PATH}" STREQUAL "") if("${EXECUTABLE_OUTPUT_PATH}" STREQUAL "")
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin") set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin")
......
# - Try to find OpenCL
# Once done this will define
#
# OPENCL_FOUND - system has OpenCL
# OPENCL_INCLUDE_DIR - the OpenCL include directory
# OPENCL_LIBRARIES - link these to use OpenCL
#
# WIN32 should work, but is untested
IF (WIN32)
FIND_PATH(OPENCL_INCLUDE_DIR CL/cl.h )
# TODO this is only a hack assuming the 64 bit library will
# not be found on 32 bit system
FIND_LIBRARY(OPENCL_LIBRARIES opencl ) #used to say opencl64
IF( OPENCL_LIBRARIES )
FIND_LIBRARY(OPENCL_LIBRARIES opencl ) #used to say opencl32
ENDIF( OPENCL_LIBRARIES )
ELSE (WIN32)
# Unix style platforms
# We also search for OpenCL in the NVIDIA GPU SDK default location
#SET(OPENCL_INCLUDE_DIR "$ENV{OPENCL_HOME}/common/inc"
# CACHE PATH "path to Opencl Include files")
#message(***** OPENCL_INCLUDE_DIR: "${OPENCL_INCLUDE_DIR}" ********)
# does not work. WHY?
#SET(inc $ENV{CUDA_LOCAL}/../OpenCL/common/inc /usr/include)
#FIND_PATH(OPENCL_INCLUDE_DIR CL/cl.h PATHS ${inc} /usr/include )
message("lib path: $ENV{LD_LIBRARY_PATH}")
#FIND_LIBRARY(OPENCL_LIBRARIES OpenCL $ENV{LD_LIBRARY_PATH})
FIND_LIBRARY(OPENCL_LIBRARIES OpenCL ENV LD_LIBRARY_PATH)
message("==============")
message("opencl_libraries: ${OPENCL_LIBRARIES}")
#message(***** OPENCL ENV: "$ENV{GPU_SDK}" ********)
#~/NVIDIA_GPU_Computing_SDK/OpenCL/common/inc/
ENDIF (WIN32)
SET( OPENCL_FOUND "NO" )
IF(OPENCL_LIBRARIES )
SET( OPENCL_FOUND "YES" )
ENDIF(OPENCL_LIBRARIES)
MARK_AS_ADVANCED(
OPENCL_INCLUDE_DIR
)
# - Try to find OpenCL
# Once done this will define
#
# OpenCL_FOUND - system has OpenCL
# OpenCL_INCLUDE_DIRS - the OpenCL include directory
# OpenCL_LIBRARIES - link these to use OpenCL
#
# WIN32 should work, but is untested
IF (WIN32)
FIND_PATH(OpenCL_INCLUDE_DIRS CL/cl.h )
# TODO this is only a hack assuming the 64 bit library will
# not be found on 32 bit system
FIND_LIBRARY(OpenCL_LIBRARIES opencl ) #used to say opencl64
IF( OpenCL_LIBRARIES )
FIND_LIBRARY(OpenCL_LIBRARIES opencl ) #used to say opencl32
ENDIF( OpenCL_LIBRARIES )
ELSE (WIN32)
FIND_LIBRARY(OpenCL_LIBRARIES OpenCL ENV LD_LIBRARY_PATH)
message("-- Found OpenCL: ${OpenCL_LIBRARIES}")
ENDIF (WIN32)
SET( OpenCL_FOUND "NO" )
IF(OpenCL_LIBRARIES )
SET( OpenCL_FOUND "YES" )
ENDIF(OpenCL_LIBRARIES)
MARK_AS_ADVANCED(
OpenCL_INCLUDE_DIRS
OpenCL_LIBRARIES
)
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