From a117400577d4d02db283936c9df97ce1dca8a496 Mon Sep 17 00:00:00 2001 From: Ozan Tonkal Date: Tue, 17 Sep 2013 18:55:10 +0200 Subject: [PATCH] ignore viz tutorials when BUILD_opencv_viz is not set --- modules/viz/test/test_viz3d.cpp | 4 ++-- samples/cpp/CMakeLists.txt | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/viz/test/test_viz3d.cpp b/modules/viz/test/test_viz3d.cpp index 94804a937..19d9f7300 100644 --- a/modules/viz/test/test_viz3d.cpp +++ b/modules/viz/test/test_viz3d.cpp @@ -124,8 +124,8 @@ TEST(Viz_viz3d, accuracy) int row_max = img.rows/downSample; int col_max = img.cols/downSample; - cv::Mat clouds[img.cols/downSample]; - cv::Mat colors[img.cols/downSample]; + cv::Mat *clouds = new cv::Mat[img.cols/downSample]; + cv::Mat *colors = new cv::Mat[img.cols/downSample]; for (int col = 0; col < col_max; ++col) { diff --git a/samples/cpp/CMakeLists.txt b/samples/cpp/CMakeLists.txt index 4115bf9fc..d5302fc86 100644 --- a/samples/cpp/CMakeLists.txt +++ b/samples/cpp/CMakeLists.txt @@ -28,6 +28,9 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND) if(HAVE_opencv_gpufilters) ocv_include_directories("${OpenCV_SOURCE_DIR}/modules/gpufilters/include") endif() + if(HAVE_opencv_viz) + ocv_include_directories("${OpenCV_SOURCE_DIR}/modules/viz/include") + endif() if(CMAKE_COMPILER_IS_GNUCXX AND NOT ENABLE_NOISY_WARNINGS) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function") @@ -55,6 +58,10 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND) if("${srcs}" MATCHES "gpu/") target_link_libraries(${the_target} opencv_gpuarithm opencv_gpufilters) endif() + + if(HAVE_opencv_viz) + target_link_libraries(${the_target} opencv_viz) + endif() set_target_properties(${the_target} PROPERTIES OUTPUT_NAME "cpp-${sample_kind}-${name}" @@ -82,6 +89,10 @@ if(BUILD_EXAMPLES AND OCV_DEPENDENCIES_FOUND) if(NOT HAVE_opencv_gpuarithm OR NOT HAVE_opencv_gpufilters) ocv_list_filterout(cpp_samples "/gpu/") endif() + + if(NOT HAVE_opencv_viz) + ocv_list_filterout(cpp_samples "viz") + endif() foreach(sample_filename ${cpp_samples}) get_filename_component(sample ${sample_filename} NAME_WE)