Skip to content

Commit ef1d4eb

Browse files
committed
Merge pull request opencv#5241 from alalek:fix_sample_opencl
2 parents edcd2c0 + 1b1246c commit ef1d4eb

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

samples/opencl/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ ocv_check_dependencies(${OPENCV_OPENCL_SAMPLES_REQUIRED_DEPS})
1818

1919
if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND)
2020

21-
find_package(OpenCL 1.2 REQUIRED)
21+
find_package(OpenCL 1.2 QUIET)
22+
if(NOT OpenCL_FOUND)
23+
message(STATUS "OpenCL samples are skipped: OpenCL SDK is required")
24+
return()
25+
endif()
2226

2327
set(project "opencl")
2428
string(TOUPPER "${project}" project_upper)

samples/opencl/opencl-opencv-interop.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
#include <iomanip>
1515
#include <stdexcept>
1616

17+
#define CL_USE_DEPRECATED_OPENCL_2_0_APIS // eliminate build warning
18+
1719
#if __APPLE__
1820
#include <OpenCL/cl.h>
1921
#else

0 commit comments

Comments
 (0)