diff --git a/tools/cli/val-surface-sharing/CMakeLists.txt b/tools/cli/val-surface-sharing/CMakeLists.txt index 0563e10..5cef490 100644 --- a/tools/cli/val-surface-sharing/CMakeLists.txt +++ b/tools/cli/val-surface-sharing/CMakeLists.txt @@ -40,17 +40,18 @@ else() target_sources(${TARGET} PRIVATE src/hw-device-vaapi.cpp) endif() -# if OpenCL is not configured, disable use of it in this tool and print warning -find_package(OpenCL CONFIG) -if(NOT OpenCL_FOUND) - message( - WARNING "*** OpenCL not found. OpenCL surface sharing will be disabled.") - set(TOOLS_ENABLE_OPENCL OFF) -endif() - # OpenCL is currently supported on Windows only for this tool -if(TOOLS_ENABLE_OPENCL) - if(WIN32) +if(WIN32) + # if OpenCL is not configured, disable use of it in this tool and print + # warning + find_package(OpenCL CONFIG) + if(NOT OpenCL_FOUND) + message( + WARNING "*** OpenCL not found. OpenCL surface sharing will be disabled.") + set(TOOLS_ENABLE_OPENCL OFF) + endif() + + if(TOOLS_ENABLE_OPENCL) target_compile_definitions(${TARGET} PRIVATE -DTOOLS_ENABLE_OPENCL) target_sources(${TARGET} PRIVATE src/process-frames-ocl-d3d11.cpp) target_link_libraries(${TARGET} PRIVATE OpenCL::OpenCL) diff --git a/tools/cli/vpl-import-export/CMakeLists.txt b/tools/cli/vpl-import-export/CMakeLists.txt index 4f0ee89..4c8bdd7 100644 --- a/tools/cli/vpl-import-export/CMakeLists.txt +++ b/tools/cli/vpl-import-export/CMakeLists.txt @@ -57,17 +57,18 @@ if(TOOLS_ENABLE_RENDER) endif() endif() -# if OpenCL is not configured, disable use of it in this tool and print warning -find_package(OpenCL CONFIG) -if(NOT OpenCL_FOUND) - message( - WARNING "*** OpenCL not found. OpenCL surface sharing will be disabled.") - set(TOOLS_ENABLE_OPENCL OFF) -endif() - # OpenCL is currently supported on Windows only for this tool -if(TOOLS_ENABLE_OPENCL) - if(WIN32) +if(WIN32) + # if OpenCL is not configured, disable use of it in this tool and print + # warning + find_package(OpenCL CONFIG) + if(NOT OpenCL_FOUND) + message( + WARNING "*** OpenCL not found. OpenCL surface sharing will be disabled.") + set(TOOLS_ENABLE_OPENCL OFF) + endif() + + if(TOOLS_ENABLE_OPENCL) target_compile_definitions(${TARGET} PRIVATE -DTOOLS_ENABLE_OPENCL) target_sources(${TARGET} PRIVATE src/process-frames-ocl-d3d11.cpp) target_link_libraries(${TARGET} PRIVATE OpenCL::OpenCL)