mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 06:03:15 +08:00
Merge pull request #12632 from mshabunin:move-opengl-sample
This commit is contained in:
commit
238a3806b0
@ -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…
Reference in New Issue
Block a user