From daead680cd06c2bc67f3a8cce1ebf015ff14812d Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Tue, 29 Jan 2013 16:38:59 +0400 Subject: [PATCH] Add option to control build of applications (feature #2568) --- CMakeLists.txt | 5 ++++- apps/haartraining/CMakeLists.txt | 4 ---- apps/traincascade/CMakeLists.txt | 4 ---- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6215028bf..ac3b3fcd3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -149,6 +149,7 @@ OCV_OPTION(WITH_OPENCLAMDBLAS "Include AMD OpenCL BLAS library support" OFF # OpenCV build components # =================================================== OCV_OPTION(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" NOT (ANDROID OR IOS) ) +OCV_OPTION(BUILD_opencv_apps "Build utility applications (used for example to train classifiers)" (NOT ANDROID) IF (NOT IOS) ) OCV_OPTION(BUILD_ANDROID_EXAMPLES "Build examples for Android platform" ON IF ANDROID ) OCV_OPTION(BUILD_DOCS "Create build rules for OpenCV Documentation" ON ) OCV_OPTION(BUILD_EXAMPLES "Build all examples" OFF ) @@ -453,7 +454,9 @@ add_subdirectory(doc) add_subdirectory(data) # extra applications -add_subdirectory(apps) +if(BUILD_opencv_apps) + add_subdirectory(apps) +endif() # examples if(BUILD_EXAMPLES OR BUILD_ANDROID_EXAMPLES OR INSTALL_PYTHON_EXAMPLES) diff --git a/apps/haartraining/CMakeLists.txt b/apps/haartraining/CMakeLists.txt index 22349ed6b..953be3b7e 100644 --- a/apps/haartraining/CMakeLists.txt +++ b/apps/haartraining/CMakeLists.txt @@ -1,7 +1,3 @@ -if(IOS OR ANDROID) - return() -endif() - SET(OPENCV_HAARTRAINING_DEPS opencv_core opencv_imgproc opencv_highgui opencv_objdetect opencv_calib3d opencv_video opencv_features2d opencv_flann opencv_legacy) ocv_check_dependencies(${OPENCV_HAARTRAINING_DEPS}) diff --git a/apps/traincascade/CMakeLists.txt b/apps/traincascade/CMakeLists.txt index 350200fc4..be60137a9 100644 --- a/apps/traincascade/CMakeLists.txt +++ b/apps/traincascade/CMakeLists.txt @@ -1,7 +1,3 @@ -if(IOS OR ANDROID) - return() -endif() - SET(OPENCV_TRAINCASCADE_DEPS opencv_core opencv_ml opencv_imgproc opencv_objdetect opencv_highgui opencv_calib3d opencv_video opencv_features2d opencv_flann opencv_legacy) ocv_check_dependencies(${OPENCV_TRAINCASCADE_DEPS})