CUDA: Compiler detection should parse more `nvcc` variables to support splayed layouts
CMake should only infer location of nvcc
and other executables from #$ TOP
output from compiler. Infer include directoy instead from #$ INCLUDES
, and libraries from #$ LIBRARIES
. This aligns them with the existing behavior nvvm
( see _CUDA_NVVMIR_LIBRARY_DIR
).
This will allow fully splayed layouts of the CUDA toolkit to be supported, like the ones that conda-forge provides going forward with CUDA 12.
Currently wrong compiler detection variables with conda's desired CUDA 12.+ layout:
- CMAKE_CUDA_COMPILER_TOOLKIT_LIBRARY_ROOT currently is
"$CONDA_PREFIX"
should be"$CONDA_PREFIX/<target>/lib"
- CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES currently is "
"$CONDA_PREFIX/include"
should be"$CONDA_PREFIX/<target>/include/"