The package cub is header only and can be used from CMake via:
find_package(cub CONFIG REQUIRED)
target_include_directories(main PRIVATE CUB::CUB)