FindCUDA: Fails with Ninja Multi-Config
Ninja Multi-Config
is also having issues with CUDA generation using the old way (cuda_add_executable
).
With a project like
cmake_minimum_required(VERSION 3.5.1)
project( cuda1 LANGUAGES CXX C)
find_package(CUDA REQUIRED)
cuda_add_executable( cuda1 main.cu )
I got similar errors
CMake Error at C:/Program Files/CMake/share/cmake-3.22/Modules/FindCUDA.cmake:2035 (add_executable):
Legacy variable expansion in source file
"D:/cuda1/build/CMakeFiles/cuda1.dir//${CONFIGURATION}/cuda1_generated_main.cu.obj" expanded to
"D:/cuda1/build/CMakeFiles/cuda1.dir///cuda1_generated_main.cu.obj"
in target "cuda1". This behavior will be removed in a future version of CMake.
This has been reported in OpenCV : https://github.com/opencv/opencv_contrib/issues/3143
And it seems related to #22124