From 9333f82be0d958d756d98789ad49e1af42757270 Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Mon, 13 Mar 2017 18:53:52 +0300 Subject: [PATCH] Reduce dependencies between modules --- modules/features2d/CMakeLists.txt | 2 +- modules/features2d/test/test_precomp.hpp | 1 - modules/highgui/CMakeLists.txt | 2 +- modules/highgui/src/precomp.hpp | 2 -- modules/java/pure_test/CMakeLists.txt | 4 +++- modules/objdetect/CMakeLists.txt | 2 +- modules/objdetect/src/precomp.hpp | 8 -------- modules/stitching/CMakeLists.txt | 2 +- modules/superres/CMakeLists.txt | 1 - 9 files changed, 7 insertions(+), 17 deletions(-) diff --git a/modules/features2d/CMakeLists.txt b/modules/features2d/CMakeLists.txt index bf7d66e433..caae24af04 100644 --- a/modules/features2d/CMakeLists.txt +++ b/modules/features2d/CMakeLists.txt @@ -1,2 +1,2 @@ set(the_description "2D Features Framework") -ocv_define_module(features2d opencv_imgproc opencv_ml opencv_flann OPTIONAL opencv_highgui WRAP java python) +ocv_define_module(features2d opencv_imgproc opencv_flann OPTIONAL opencv_highgui WRAP java python) diff --git a/modules/features2d/test/test_precomp.hpp b/modules/features2d/test/test_precomp.hpp index 893b29b69b..bce72f7296 100644 --- a/modules/features2d/test/test_precomp.hpp +++ b/modules/features2d/test/test_precomp.hpp @@ -13,7 +13,6 @@ #include "opencv2/imgproc.hpp" #include "opencv2/features2d.hpp" #include "opencv2/imgcodecs.hpp" -#include "opencv2/ml.hpp" #include #endif diff --git a/modules/highgui/CMakeLists.txt b/modules/highgui/CMakeLists.txt index b0363c4482..bba5b8c1da 100644 --- a/modules/highgui/CMakeLists.txt +++ b/modules/highgui/CMakeLists.txt @@ -1,5 +1,5 @@ set(the_description "High-level GUI and Media I/O") -ocv_add_module(highgui opencv_imgproc OPTIONAL opencv_imgcodecs opencv_videoio WRAP python) +ocv_add_module(highgui opencv_imgproc opencv_imgcodecs OPTIONAL opencv_videoio WRAP python) # ---------------------------------------------------------------------------- # CMake file for highgui. See root CMakeLists.txt diff --git a/modules/highgui/src/precomp.hpp b/modules/highgui/src/precomp.hpp index d9e7ad8b1c..40af37cd86 100644 --- a/modules/highgui/src/precomp.hpp +++ b/modules/highgui/src/precomp.hpp @@ -50,10 +50,8 @@ #include "opencv2/imgproc/imgproc_c.h" #include "opencv2/highgui/highgui_c.h" -#ifdef HAVE_OPENCV_IMGCODECS #include "opencv2/imgcodecs.hpp" #include "opencv2/imgcodecs/imgcodecs_c.h" -#endif #include #include diff --git a/modules/java/pure_test/CMakeLists.txt b/modules/java/pure_test/CMakeLists.txt index 7d78414994..95b7e47512 100644 --- a/modules/java/pure_test/CMakeLists.txt +++ b/modules/java/pure_test/CMakeLists.txt @@ -1,4 +1,6 @@ -if(NOT ANT_EXECUTABLE) +if(NOT ANT_EXECUTABLE + OR NOT BUILD_opencv_imgcodecs + OR NOT BUILD_opencv_calib3d) return() endif() diff --git a/modules/objdetect/CMakeLists.txt b/modules/objdetect/CMakeLists.txt index d42e9e8f11..862d564cc7 100644 --- a/modules/objdetect/CMakeLists.txt +++ b/modules/objdetect/CMakeLists.txt @@ -1,2 +1,2 @@ set(the_description "Object Detection") -ocv_define_module(objdetect opencv_core opencv_imgproc opencv_ml OPTIONAL opencv_highgui WRAP java python) +ocv_define_module(objdetect opencv_core opencv_imgproc WRAP java python) diff --git a/modules/objdetect/src/precomp.hpp b/modules/objdetect/src/precomp.hpp index 97b976baf2..448d8b19b7 100644 --- a/modules/objdetect/src/precomp.hpp +++ b/modules/objdetect/src/precomp.hpp @@ -46,16 +46,8 @@ #include "opencv2/objdetect.hpp" #include "opencv2/imgproc.hpp" -#include "opencv2/ml.hpp" - #include "opencv2/core/utility.hpp" #include "opencv2/core/ocl.hpp" - -#include "opencv2/opencv_modules.hpp" -#ifdef HAVE_OPENCV_HIGHGUI -# include "opencv2/highgui.hpp" -#endif - #include "opencv2/core/private.hpp" #ifdef HAVE_TEGRA_OPTIMIZATION diff --git a/modules/stitching/CMakeLists.txt b/modules/stitching/CMakeLists.txt index 0e4f39a99d..2802ab8be7 100644 --- a/modules/stitching/CMakeLists.txt +++ b/modules/stitching/CMakeLists.txt @@ -8,6 +8,6 @@ set(STITCHING_CONTRIB_DEPS "opencv_xfeatures2d") if(BUILD_SHARED_LIBS AND BUILD_opencv_world AND OPENCV_WORLD_EXCLUDE_EXTRA_MODULES) set(STITCHING_CONTRIB_DEPS "") endif() -ocv_define_module(stitching opencv_imgproc opencv_features2d opencv_calib3d opencv_objdetect +ocv_define_module(stitching opencv_imgproc opencv_features2d opencv_calib3d OPTIONAL opencv_cudaarithm opencv_cudafilters opencv_cudafeatures2d opencv_cudalegacy ${STITCHING_CONTRIB_DEPS} WRAP python) diff --git a/modules/superres/CMakeLists.txt b/modules/superres/CMakeLists.txt index 7c3fc14a17..34c9297a1b 100644 --- a/modules/superres/CMakeLists.txt +++ b/modules/superres/CMakeLists.txt @@ -3,7 +3,6 @@ if(IOS OR WINRT) endif() set(the_description "Super Resolution") -ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4127 -Wundef -Wshadow) ocv_define_module(superres opencv_imgproc opencv_video OPTIONAL opencv_videoio opencv_cudaarithm opencv_cudafilters opencv_cudawarping opencv_cudaimgproc opencv_cudaoptflow opencv_cudacodec WRAP python)