Moved OpenGL sample to opengl folder

pull/12632/head
Maksim Shabunin 6 years ago
parent 0a23c1bf11
commit a0211a1c2f
  1. 3
      samples/cpp/CMakeLists.txt
  2. 3
      samples/gpu/CMakeLists.txt
  3. 18
      samples/opengl/CMakeLists.txt
  4. 0
      samples/opengl/opengl.cpp

@ -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()

@ -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})

@ -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()

Loading…
Cancel
Save