diff --git a/cmake/OpenCVDetectDirectX.cmake b/cmake/OpenCVDetectDirectX.cmake index 2224511a97..fbe4a71185 100644 --- a/cmake/OpenCVDetectDirectX.cmake +++ b/cmake/OpenCVDetectDirectX.cmake @@ -22,4 +22,9 @@ if(WIN32) set(HAVE_D3D11 ON) set(HAVE_D3D10 ON) set(HAVE_D3D9 ON) + + if(HAVE_OPENCL AND WITH_OPENCL_D3D11_NV AND EXISTS "${OPENCL_INCLUDE_DIR}/CL/cl_d3d11_ext.h") + set(HAVE_OPENCL_D3D11_NV ON) + endif() + endif() diff --git a/cmake/OpenCVDetectOpenCL.cmake b/cmake/OpenCVDetectOpenCL.cmake index 6cd7552fa0..5349d12b69 100644 --- a/cmake/OpenCVDetectOpenCL.cmake +++ b/cmake/OpenCVDetectOpenCL.cmake @@ -11,10 +11,6 @@ mark_as_advanced(OPENCL_INCLUDE_DIR OPENCL_LIBRARY) if(OPENCL_FOUND) - if(WITH_OPENCL_D3D11_NV AND EXISTS "${OPENCL_INCLUDE_DIR}/CL/cl_d3d11_ext.h") - set(HAVE_OPENCL_D3D11_NV ON) - endif() - if(OPENCL_LIBRARY) set(HAVE_OPENCL_STATIC ON) set(OPENCL_LIBRARIES "${OPENCL_LIBRARY}") @@ -82,4 +78,7 @@ if(OPENCL_FOUND) list(APPEND OPENCL_INCLUDE_DIRS "${CLAMDBLAS_INCLUDE_DIR}") endif() endif() + + # check WITH_OPENCL_D3D11_NV is located in OpenCVDetectDirectX.cmake file + endif()