From 724f5e7f190e281c33dbaf57b0da49da8c08d140 Mon Sep 17 00:00:00 2001 From: Andrey Pavlenko Date: Mon, 16 Jun 2014 11:18:52 +0400 Subject: [PATCH] Don't build CUDA modules stubs by default (use `-DBUILD_CUDA_STUBS=ON` if need them) --- CMakeLists.txt | 1 + modules/cuda/CMakeLists.txt | 2 +- modules/cudaarithm/CMakeLists.txt | 2 +- modules/cudabgsegm/CMakeLists.txt | 2 +- modules/cudacodec/CMakeLists.txt | 2 +- modules/cudafeatures2d/CMakeLists.txt | 2 +- modules/cudafilters/CMakeLists.txt | 2 +- modules/cudaimgproc/CMakeLists.txt | 2 +- modules/cudaoptflow/CMakeLists.txt | 2 +- modules/cudastereo/CMakeLists.txt | 2 +- modules/cudawarping/CMakeLists.txt | 2 +- 11 files changed, 11 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 96f104a..5abf449 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -175,6 +175,7 @@ OCV_OPTION(BUILD_WITH_STATIC_CRT "Enables use of staticaly linked CRT for sta OCV_OPTION(BUILD_FAT_JAVA_LIB "Create fat java wrapper containing the whole OpenCV library" ON IF NOT BUILD_SHARED_LIBS AND CMAKE_COMPILER_IS_GNUCXX ) OCV_OPTION(BUILD_ANDROID_SERVICE "Build OpenCV Manager for Google Play" OFF IF ANDROID AND ANDROID_SOURCE_TREE ) OCV_OPTION(BUILD_ANDROID_PACKAGE "Build platform-specific package for Google Play" OFF IF ANDROID ) +OCV_OPTION(BUILD_CUDA_STUBS "Build CUDA modules stubs when no CUDA SDK" OFF IF (NOT IOS) ) # 3rd party libs OCV_OPTION(BUILD_ZLIB "Build zlib from source" WIN32 OR APPLE ) diff --git a/modules/cuda/CMakeLists.txt b/modules/cuda/CMakeLists.txt index a79b7d3..389e90b 100644 --- a/modules/cuda/CMakeLists.txt +++ b/modules/cuda/CMakeLists.txt @@ -1,4 +1,4 @@ -if(IOS) +if(IOS OR (NOT HAVE_CUDA AND NOT BUILD_CUDA_STUBS)) ocv_module_disable(cuda) endif() diff --git a/modules/cudaarithm/CMakeLists.txt b/modules/cudaarithm/CMakeLists.txt index e3df9d2..c819ec9 100644 --- a/modules/cudaarithm/CMakeLists.txt +++ b/modules/cudaarithm/CMakeLists.txt @@ -1,4 +1,4 @@ -if(IOS) +if(IOS OR (NOT HAVE_CUDA AND NOT BUILD_CUDA_STUBS)) ocv_module_disable(cudaarithm) endif() diff --git a/modules/cudabgsegm/CMakeLists.txt b/modules/cudabgsegm/CMakeLists.txt index 526e4b1..3a88282 100644 --- a/modules/cudabgsegm/CMakeLists.txt +++ b/modules/cudabgsegm/CMakeLists.txt @@ -1,4 +1,4 @@ -if(IOS) +if(IOS OR (NOT HAVE_CUDA AND NOT BUILD_CUDA_STUBS)) ocv_module_disable(cudabgsegm) endif() diff --git a/modules/cudacodec/CMakeLists.txt b/modules/cudacodec/CMakeLists.txt index 30d95ba..ace7cb3 100644 --- a/modules/cudacodec/CMakeLists.txt +++ b/modules/cudacodec/CMakeLists.txt @@ -1,4 +1,4 @@ -if(IOS OR APPLE) +if(IOS OR APPLE OR (NOT HAVE_CUDA AND NOT BUILD_CUDA_STUBS)) ocv_module_disable(cudacodec) endif() diff --git a/modules/cudafeatures2d/CMakeLists.txt b/modules/cudafeatures2d/CMakeLists.txt index 69eba34..1db7462 100644 --- a/modules/cudafeatures2d/CMakeLists.txt +++ b/modules/cudafeatures2d/CMakeLists.txt @@ -1,4 +1,4 @@ -if(IOS) +if(IOS OR (NOT HAVE_CUDA AND NOT BUILD_CUDA_STUBS)) ocv_module_disable(cudafeatures2d) endif() diff --git a/modules/cudafilters/CMakeLists.txt b/modules/cudafilters/CMakeLists.txt index 8589881..dfc814c 100644 --- a/modules/cudafilters/CMakeLists.txt +++ b/modules/cudafilters/CMakeLists.txt @@ -1,4 +1,4 @@ -if(IOS) +if(IOS OR (NOT HAVE_CUDA AND NOT BUILD_CUDA_STUBS)) ocv_module_disable(cudafilters) endif() diff --git a/modules/cudaimgproc/CMakeLists.txt b/modules/cudaimgproc/CMakeLists.txt index 9617029..089135d 100644 --- a/modules/cudaimgproc/CMakeLists.txt +++ b/modules/cudaimgproc/CMakeLists.txt @@ -1,4 +1,4 @@ -if(IOS) +if(IOS OR (NOT HAVE_CUDA AND NOT BUILD_CUDA_STUBS)) ocv_module_disable(cudaimgproc) endif() diff --git a/modules/cudaoptflow/CMakeLists.txt b/modules/cudaoptflow/CMakeLists.txt index 27dbc6a..b7a2109 100644 --- a/modules/cudaoptflow/CMakeLists.txt +++ b/modules/cudaoptflow/CMakeLists.txt @@ -1,4 +1,4 @@ -if(IOS) +if(IOS OR (NOT HAVE_CUDA AND NOT BUILD_CUDA_STUBS)) ocv_module_disable(cudaoptflow) endif() diff --git a/modules/cudastereo/CMakeLists.txt b/modules/cudastereo/CMakeLists.txt index 6f63add..9f3d0f2 100644 --- a/modules/cudastereo/CMakeLists.txt +++ b/modules/cudastereo/CMakeLists.txt @@ -1,4 +1,4 @@ -if(IOS) +if(IOS OR (NOT HAVE_CUDA AND NOT BUILD_CUDA_STUBS)) ocv_module_disable(cudastereo) endif() diff --git a/modules/cudawarping/CMakeLists.txt b/modules/cudawarping/CMakeLists.txt index a6b38f9..97f3e89 100644 --- a/modules/cudawarping/CMakeLists.txt +++ b/modules/cudawarping/CMakeLists.txt @@ -1,4 +1,4 @@ -if(IOS) +if(IOS OR (NOT HAVE_CUDA AND NOT BUILD_CUDA_STUBS)) ocv_module_disable(cudawarping) endif() -- 2.7.4