From 3d5ab56a684b1c4980ae5f155cc3e64d69a47adb Mon Sep 17 00:00:00 2001 From: cudawarped <12133430+cudawarped@users.noreply.github.com> Date: Thu, 27 Mar 2025 16:40:01 +0200 Subject: [PATCH] Add comment for CMake 3.18+: if CMAKE_CUDA_ARCHITECTURES is empty enable_language(CUDA) sets it to the default architecture chosen by the compiler, to trigger the OpenCV custom CUDA architecture search an empty value needs to be respected see https://github.com/opencv/opencv/pull/25941. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8fbfd0563d..7985623ffb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -684,6 +684,7 @@ if(ENABLE_CUDA_FIRST_CLASS_LANGUAGE) cmake_policy(SET CMP0092 NEW) # CMake 3.15+: leave warning flags out of default CMAKE__FLAGS flags. if(CMAKE_CUDA_COMPILER) + # CMake 3.18+: if CMAKE_CUDA_ARCHITECTURES is empty enable_language(CUDA) sets it to the default architecture chosen by the compiler, to trigger the OpenCV custom CUDA architecture search an empty value needs to be respected see https://github.com/opencv/opencv/pull/25941. if(CMAKE_CUDA_ARCHITECTURES) set(USER_DEFINED_CMAKE_CUDA_ARCHITECTURES TRUE) endif()