FindCUDAToolkit's `CUDA::cupti` target is broken with CUDA 10+
See this discussion for context.
The CUDA::cupti
target is missing some paths and target dependencies. Ideally, we'd just be able to do:
find_package(CUDAToolkit)
target_link_libraries(foo PUBLIC CUDA::cupti)
but this doesn't work -- additional dependencies and include paths are needed, along with a healthy dose of platform-specific edge case handling:
if (WIN32)
message("Don't forget to add ${CUDAToolkit_LIBRARY_ROOT}/extras/CUPTI/lib64 in your PATH!")
endif ()
target_include_directories(foo PRIVATE ${CUDAToolkit_LIBRARY_ROOT}/extras/CUPTI/include)
target_link_directories(foo PUBLIC ${CUDAToolkit_LIBRARY_ROOT}/extras/CUPTI/lib64)
target_link_libraries(foo PUBLIC cupti nvperf_host nvperf_target)
cc: @robertmaynard