The following error message may be encountered when building CUDA code with CMake:
error LNK2019: unresolved external symbol __cudaRegisterLinkedBinary
It is caused by generated glue code not being linked in. The glue code is generated into files named with the project and a suffix:
myprojectname.device-link.obj
Ensure CUDA is enabled as a language for the project: