基于CMake构建C/C++程序,报错提示说:

Unknown CMake command "cuda_add_library".

仔细检查了CMakeLists.txt和各种.cmake文件,发现find_package(CUDA)没有被调用,导致cuda_add_library()命令没有被识别。开启调用即可。

Greatness is never a given, it must be earned.