diff --git a/modules/cudev/CMakeLists.txt b/modules/cudev/CMakeLists.txt index 742f7c8ae55..f6d51a501ce 100644 --- a/modules/cudev/CMakeLists.txt +++ b/modules/cudev/CMakeLists.txt @@ -6,20 +6,24 @@ set(the_description "CUDA device layer") ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4189 /wd4505 -Wundef -Wmissing-declarations -Wunused-function -Wunused-variable -Wenum-compare -Wshadow) -ocv_add_module(cudev) +set(extra_dependencies "") +set(optional_dependencies "") -ocv_module_include_directories(opencv_core) - -file(GLOB_RECURSE lib_hdrs "${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/*.hpp") -file(GLOB lib_srcs "${CMAKE_CURRENT_LIST_DIR}/src/*.cpp") +if(ENABLE_CUDA_FIRST_CLASS_LANGUAGE) + if(UNIX AND NOT BUILD_SHARED_LIBS AND CUDA_VERSION_STRING VERSION_GREATER_EQUAL 9.2 AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.23) + set(CUDA_FFT_LIB_EXT "_static_nocallback") + endif() + list(APPEND extra_dependencies CUDA::cudart_static) -source_group("Include" FILES ${lib_hdrs}) -source_group("Src" FILES ${lib_srcs}) +endif() -ocv_glob_module_sources(HEADERS ${lib_hdrs} SOURCES ${lib_srcs}) +ocv_add_module(cudev ${extra_dependencies} OPTIONAL ${optional_dependencies} WRAP python) +ocv_module_include_directories(opencv_core) +ocv_glob_module_sources() ocv_create_module() + if(BUILD_TESTS AND NOT BUILD_opencv_world) add_subdirectory(test) endif()