CUDAToolkit: culibos not well ordered
When using FindCUDAToolkit.cmake
, there are targets CUDA::cusparse_static
and CUDA::curand_static
, both of which depend on CUDA::culibos
. However, when linking a downstream target to just CUDA::cusparse_static
and CUDA::curand_static
, the actual link line has libculibos.a
in between libcusparse_static.a
and libcurand_static.a
instead of after both of them like it should be. I'm not completely sure what the cause of this is, but maybe it is due to the fact that FindCUDAToolkit.cmake
, for example for CUDA::cusparse_static
, will create that target as an imported interface library and then link it to libcusparse_static.a
instead of setting libcusparse_static.a
as its IMPORTED_LOCATION
? Am I wrong about this being the cause?
https://gitlab.kitware.com/cmake/cmake/-/blob/v3.21.0-rc1/Modules/FindCUDAToolkit.cmake#L849