set(the_description "The Core Functionality")
-if (ENABLE_DYNAMIC_CUDA)
+if (NOT HAVE_CUDA OR ENABLE_DYNAMIC_CUDA)
ocv_add_module(core PRIVATE_REQUIRED ${ZLIB_LIBRARIES})
else()
ocv_add_module(core PRIVATE_REQUIRED ${ZLIB_LIBRARIES} ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY})
if(ENABLE_DYNAMIC_CUDA)
add_definitions(-DDYNAMIC_CUDA_SUPPORT)
else()
- add_definitions(-DUSE_CUDA)
+ if (HAVE_CUDA)
+ add_definitions(-DUSE_CUDA)
+ endif()
endif()
if(HAVE_CUDA)
file(GLOB lib_cuda_hdrs "include/opencv2/${name}/cuda/*.hpp" "include/opencv2/${name}/cuda/*.h")
file(GLOB lib_cuda_hdrs_detail "include/opencv2/${name}/cuda/detail/*.hpp" "include/opencv2/${name}/cuda/detail/*.h")
-if (NOT ENABLE_DYNAMIC_CUDA)
- file(GLOB lib_cuda "../dynamicuda/src/cuda/*.cu*")
+if (HAVE_CUDA AND NOT ENABLE_DYNAMIC_CUDA)
+ file(GLOB lib_cuda "../dynamicuda/src/cuda/*.cu*")
endif()
source_group("Cuda Headers" FILES ${lib_cuda_hdrs})
source_group("Cuda Headers\\Detail" FILES ${lib_cuda_hdrs_detail})
-if (NOT ENABLE_DYNAMIC_CUDA)
+if (HAVE_CUDA AND NOT ENABLE_DYNAMIC_CUDA)
source_group("Src\\Cuda" FILES ${lib_cuda} ${lib_cuda_hdrs})
endif()
-if (ENABLE_DYNAMIC_CUDA)
+if (NOT HAVE_CUDA OR ENABLE_DYNAMIC_CUDA)
ocv_glob_module_sources(SOURCES "${opencv_core_BINARY_DIR}/version_string.inc"
HEADERS ${lib_cuda_hdrs} ${lib_cuda_hdrs_detail})
else()
static CudaDeviceInfoFuncTable impl;
static DeviceInfoFuncTable* funcTable = &impl;
#else
- static EmptyFuncTable stub;
+ static EmptyDeviceInfoFuncTable stub;
static DeviceInfoFuncTable* funcTable = &stub;
#endif
#endif
Ptr<FeaturesFinder> finder;
if (features_type == "surf")
{
-#if defined(HAVE_OPENCV_NONFREE) && defined(HAVE_OPENCV_GPU)
+#if defined(HAVE_OPENCV_NONFREE) && defined(HAVE_OPENCV_GPU) && !defined(ANDROID)
if (try_gpu && gpu::getCudaEnabledDeviceCount() > 0)
finder = new SurfFeaturesFinderGpu();
else
// Warp images and their masks
Ptr<WarperCreator> warper_creator;
-#ifdef HAVE_OPENCV_GPU
+#if defined(HAVE_OPENCV_GPU) && !defined(ANDROID)
if (try_gpu && gpu::getCudaEnabledDeviceCount() > 0)
{
if (warp_type == "plane") warper_creator = new cv::PlaneWarperGpu();
seam_finder = new detail::VoronoiSeamFinder();
else if (seam_find_type == "gc_color")
{
-#ifdef HAVE_OPENCV_GPU
+#if defined(HAVE_OPENCV_GPU) && !defined(ANDROID)
if (try_gpu && gpu::getCudaEnabledDeviceCount() > 0)
seam_finder = new detail::GraphCutSeamFinderGpu(GraphCutSeamFinderBase::COST_COLOR);
else
}
else if (seam_find_type == "gc_colorgrad")
{
-#ifdef HAVE_OPENCV_GPU
+#if defined(HAVE_OPENCV_GPU) && !defined(ANDROID)
if (try_gpu && gpu::getCudaEnabledDeviceCount() > 0)
seam_finder = new detail::GraphCutSeamFinderGpu(GraphCutSeamFinderBase::COST_COLOR_GRAD);
else