cmake编译opencv3.2时关于cuda的问题

出现一大堆的错误

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_cufft_LIBRARY (ADVANCED)
linked by target "opencv_cudev" in directory E:/opencv/sources/modules/cudev
linked by target "opencv_test_cudev" in directory E:/opencv/sources/modules/cudev/test
linked by target "opencv_core" in directory E:/opencv/sources/modules/core

 

Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_cufft_LIBRARY (ADVANCED)
linked by target "opencv_cudev" in directory E:/opencv/sources/modules/cudev
linked by target "opencv_test_cudev" in directory E:/opencv/sources/modules/cudev/test

 

linked by target "opencv_core" in directory E:/opencv/sources/modules/core

然后把with_CUDA的状态为:不选择,再次configure没有问题。

 

 

上面的解决方法是在你不需要使用cuda的情况下,之前也没有用到cuda,索性就编译时就不加入cuda了。现在使用cuda了,再次编译,又出现了上面的问题。

如果需要使用cuda,出现这种错误,在网上搜索的结果是,cuda9对opencv3.2架构不再支持。

我重新下载了opencv3.4,使用cuda9.2(或者cuda9.0/9.1/9.2),编译,没有再出现错误。

你可能感兴趣的:(cmake配置系列)