Merge pull request #27164 from cudawarped:cmake_add_comment_for_cmp0104

cuda:: Add comment describing code around enable_language(CUDA) in CMakeLists.txt
This commit is contained in:
Alexander Smorkalov 2025-03-30 13:36:29 +03:00 committed by GitHub
commit 767407e711
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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_<LANG>_FLAGS flags. cmake_policy(SET CMP0092 NEW) # CMake 3.15+: leave warning flags out of default CMAKE_<LANG>_FLAGS flags.
if(CMAKE_CUDA_COMPILER) 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) if(CMAKE_CUDA_ARCHITECTURES)
set(USER_DEFINED_CMAKE_CUDA_ARCHITECTURES TRUE) set(USER_DEFINED_CMAKE_CUDA_ARCHITECTURES TRUE)
endif() endif()