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 96f104a98..5abf44980 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 a79b7d3bf..389e90b47 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 e3df9d284..c819ec928 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 526e4b185..3a882824b 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 30d95bacb..ace7cb376 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 69eba34b1..1db746250 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 858988115..dfc814cfa 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 961702966..089135d71 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 27dbc6a51..b7a2109fb 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 6f63add8d..9f3d0f241 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 a6b38f954..97f3e8983 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()