From 5dc7752d54e78f298c2f1e7cdd80f797945396e2 Mon Sep 17 00:00:00 2001 From: Niko Li Date: Tue, 17 Jul 2012 06:49:32 +0000 Subject: [PATCH] fix a bug of detect opencl --- cmake/OpenCVDetectOpenCL.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmake/OpenCVDetectOpenCL.cmake b/cmake/OpenCVDetectOpenCL.cmake index d000926..3b021bc 100644 --- a/cmake/OpenCVDetectOpenCL.cmake +++ b/cmake/OpenCVDetectOpenCL.cmake @@ -16,14 +16,14 @@ else() else() set(OPENCL_LIB_SEARCH_PATH ${OPENCL_LIB_SEARCH_PATH} ${ENV_AMDSTREAMSDKROOT}/lib/x86_64) endif() - elif(ENV_CUDAPATH AND WIN32) + elseif(ENV_CUDAPATH AND WIN32) set(OPENCL_INCLUDE_SEARCH_PATH ${ENV_CUDA_PATH}/include) if(CMAKE_SIZEOF_VOID_P EQUAL 4) set(OPENCL_LIB_SEARCH_PATH ${OPENCL_LIB_SEARCH_PATH} ${ENV_CUDA_PATH}/lib/Win32) else() set(OPENCL_LIB_SEARCH_PATH ${OPENCL_LIB_SEARCH_PATH} ${ENV_CUDA_PATH}/lib/x64) endif() - elif(ENV_OPENCLROOT AND UNIX) + elseif(ENV_OPENCLROOT AND UNIX) set(OPENCL_INCLUDE_SEARCH_PATH ${ENV_OPENCLROOT}/inc) if(CMAKE_SIZEOF_VOID_P EQUAL 4) set(OPENCL_LIB_SEARCH_PATH ${OPENCL_LIB_SEARCH_PATH} /usr/lib) @@ -57,8 +57,11 @@ else() if(OPENCL_FOUND) set(OPENCL_LIBRARIES ${OPENCL_LIBRARY}) + set(HAVE_OPENCL 1) else() set(OPENCL_LIBRARIES) endif() + else() + set(HAVE_OPENCL 1) endif() endif() -- 2.7.4