From a0211a1c2f63babdbf03c7d30d423edefdded97a Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Mon, 24 Sep 2018 13:09:18 +0300 Subject: [PATCH] Moved OpenGL sample to opengl folder --- samples/cpp/CMakeLists.txt | 3 --- samples/gpu/CMakeLists.txt | 3 --- samples/opengl/CMakeLists.txt | 18 +++++++++--------- samples/{gpu => opengl}/opengl.cpp | 0 4 files changed, 9 insertions(+), 15 deletions(-) rename samples/{gpu => opengl}/opengl.cpp (100%) diff --git a/samples/cpp/CMakeLists.txt b/samples/cpp/CMakeLists.txt index d12cc9d7d6..c3786aaf74 100644 --- a/samples/cpp/CMakeLists.txt +++ b/samples/cpp/CMakeLists.txt @@ -27,9 +27,6 @@ endif() project(cpp_samples) ocv_include_modules_recurse(${OPENCV_CPP_SAMPLES_REQUIRED_DEPS}) file(GLOB_RECURSE cpp_samples RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp) -if(NOT HAVE_OPENGL) - ocv_list_filterout(cpp_samples Qt_sample) -endif() if(NOT HAVE_opencv_cudaarithm OR NOT HAVE_opencv_cudafilters) ocv_list_filterout(cpp_samples "/gpu/") endif() diff --git a/samples/gpu/CMakeLists.txt b/samples/gpu/CMakeLists.txt index 1c65145aca..6aa6b87afa 100644 --- a/samples/gpu/CMakeLists.txt +++ b/samples/gpu/CMakeLists.txt @@ -50,9 +50,6 @@ if((CV_GCC OR CV_CLANG) AND NOT ENABLE_NOISY_WARNINGS) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function") endif() file(GLOB all_samples RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp) -if(NOT HAVE_OPENGL) - ocv_list_filterout(all_samples "opengl") -endif() foreach(sample_filename ${all_samples}) ocv_define_sample(tgt ${sample_filename} gpu) ocv_target_link_libraries(${tgt} ${OPENCV_LINKER_LIBS} ${OPENCV_CUDA_SAMPLES_REQUIRED_DEPS}) diff --git a/samples/opengl/CMakeLists.txt b/samples/opengl/CMakeLists.txt index e383abd899..31a075c0cf 100644 --- a/samples/opengl/CMakeLists.txt +++ b/samples/opengl/CMakeLists.txt @@ -1,15 +1,9 @@ if(APPLE) - return() + return() endif() if(UNIX) find_package(X11 QUIET) - if(NOT X11_FOUND) - message(STATUS "OpenGL samples require development files for libX11") - return() - endif() - include_directories(${X11_INCLUDE_DIR}) - set(SAMPLE_LINKER_DEPS "${X11_LIBRARIES}") endif() SET(OPENCV_OPENGL_SAMPLES_REQUIRED_DEPS @@ -24,10 +18,16 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND) project(opengl_samples) ocv_include_modules_recurse(${OPENCV_OPENGL_SAMPLES_REQUIRED_DEPS}) file(GLOB all_samples RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp) + if(NOT X11_FOUND) + ocv_list_filterout(all_samples "opengl_interop") + endif() foreach(sample_filename ${all_samples}) ocv_define_sample(tgt ${sample_filename} opengl) - ocv_target_link_libraries(${tgt} - ${OPENCV_LINKER_LIBS} ${OPENCV_OPENGL_SAMPLES_REQUIRED_DEPS} ${SAMPLE_LINKER_DEPS}) + ocv_target_link_libraries(${tgt} ${OPENCV_LINKER_LIBS} ${OPENCV_OPENGL_SAMPLES_REQUIRED_DEPS}) + if(sample_filename STREQUAL "opengl_interop.cpp") + ocv_target_link_libraries(${tgt} ${X11_LIBRARIES}) + ocv_target_include_directories(${tgt} ${X11_INCLUDE_DIR}) + endif() endforeach() endif() diff --git a/samples/gpu/opengl.cpp b/samples/opengl/opengl.cpp similarity index 100% rename from samples/gpu/opengl.cpp rename to samples/opengl/opengl.cpp