mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 08:13:04 +04:00
Merge branch 4.x
This commit is contained in:
@@ -25,6 +25,9 @@ if(NOT BUILD_EXAMPLES OR NOT OCV_DEPENDENCIES_FOUND)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(DEPS_example_snippet_imgproc_segmentation opencv_core opencv_imgproc)
|
||||
set(DEPS_example_cpp_intelligent_scissors opencv_core opencv_imgproc opencv_imgcodecs opencv_highgui)
|
||||
|
||||
project(cpp_samples)
|
||||
ocv_include_modules_recurse(${OPENCV_CPP_SAMPLES_REQUIRED_DEPS})
|
||||
file(GLOB_RECURSE cpp_samples RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
|
||||
@@ -32,13 +35,20 @@ if(NOT HAVE_opencv_cudaarithm OR NOT HAVE_opencv_cudafilters)
|
||||
ocv_list_filterout(cpp_samples "/gpu/")
|
||||
endif()
|
||||
ocv_list_filterout(cpp_samples "real_time_pose_estimation/")
|
||||
ocv_list_filterout(cpp_samples "parallel_backend/")
|
||||
foreach(sample_filename ${cpp_samples})
|
||||
set(package "cpp")
|
||||
if(sample_filename MATCHES "tutorial_code")
|
||||
if(sample_filename MATCHES "tutorial_code/snippet")
|
||||
set(package "snippet")
|
||||
elseif(sample_filename MATCHES "tutorial_code")
|
||||
set(package "tutorial")
|
||||
endif()
|
||||
ocv_define_sample(tgt ${sample_filename} ${package})
|
||||
ocv_target_link_libraries(${tgt} PRIVATE ${OPENCV_LINKER_LIBS} ${OPENCV_CPP_SAMPLES_REQUIRED_DEPS})
|
||||
set(deps ${OPENCV_CPP_SAMPLES_REQUIRED_DEPS})
|
||||
if(DEFINED DEPS_${tgt})
|
||||
set(deps ${DEPS_${tgt}})
|
||||
endif()
|
||||
ocv_target_link_libraries(${tgt} PRIVATE ${OPENCV_LINKER_LIBS} ${deps})
|
||||
if(sample_filename MATCHES "/gpu/" AND HAVE_opencv_cudaarithm AND HAVE_opencv_cuda_filters)
|
||||
ocv_target_link_libraries(${tgt} PRIVATE opencv_cudaarithm opencv_cudafilters)
|
||||
endif()
|
||||
@@ -59,3 +69,11 @@ foreach(sample_filename ${cpp_samples})
|
||||
endforeach()
|
||||
|
||||
include("tutorial_code/calib3d/real_time_pose_estimation/CMakeLists.txt" OPTIONAL)
|
||||
|
||||
# Standalone samples only
|
||||
if(OpenCV_FOUND AND NOT CMAKE_VERSION VERSION_LESS "3.1")
|
||||
add_subdirectory("example_cmake")
|
||||
endif()
|
||||
if(OpenCV_FOUND AND NOT CMAKE_VERSION VERSION_LESS "3.9")
|
||||
add_subdirectory("tutorial_code/core/parallel_backend")
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user