diff --git a/CMakeLists.txt b/CMakeLists.txt index 96f104a987..5abf449804 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 a79b7d3bf4..389e90b47e 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 e3df9d2844..c819ec928d 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 526e4b1850..3a882824b1 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 30d95bacb6..ace7cb3763 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 69eba34b1f..1db7462501 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 8589881153..dfc814cfa0 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 961702966b..089135d713 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 27dbc6a519..b7a2109fbb 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 6f63add8d8..9f3d0f2415 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 a6b38f9545..97f3e8983b 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()