From 8484c8af7c5a41b34fa5f8a5c81c9ee7b4b22ceb Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Wed, 8 Aug 2018 14:16:29 +0300 Subject: [PATCH] samples(gpu): fix build (invalid access to cvconfig.h from sample) via find_package(OpenCV) --- samples/gpu/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/samples/gpu/CMakeLists.txt b/samples/gpu/CMakeLists.txt index cdf9ee8562..4c55ec92ad 100644 --- a/samples/gpu/CMakeLists.txt +++ b/samples/gpu/CMakeLists.txt @@ -90,6 +90,12 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND) list(REMOVE_ITEM all_samples "driver_api_multi.cpp") list(REMOVE_ITEM all_samples "driver_api_stereo_multi.cpp") endif() + if(NOT HAVE_CUDA + OR NOT HAVE_TBB + OR OpenCV_FOUND # via find_package() there is no access to cvconfig.h + ) + list(REMOVE_ITEM all_samples "pyrlk_optical_flow_multithreading.cpp") + endif() foreach(sample_filename ${all_samples}) get_filename_component(sample ${sample_filename} NAME_WE) @@ -111,6 +117,9 @@ if (OCV_DEPENDENCIES_FOUND AND INSTALL_C_EXAMPLES AND NOT WIN32) list_filterout(install_list ".*driver_api_multi.cpp") list_filterout(install_list ".*driver_api_stereo_multi.cpp") endif() + if(NOT HAVE_CUDA OR NOT HAVE_TBB) + list(REMOVE_ITEM install_list "pyrlk_optical_flow_multithreading.cpp") + endif() install(FILES ${install_list} DESTINATION "${OPENCV_SAMPLES_SRC_INSTALL_PATH}/gpu" PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ COMPONENT samples)