当前位置:   article > 正文

Policy CMP0146 is not set: The FindCUDA module is removed

policy cmp0146 is not set: the findcuda module is removed.
  1. CMake Warning (dev) at CMakeLists.txt:8 (find_package):
  2. Policy CMP0146 is not set: The FindCUDA module is removed. Run "cmake
  3. --help-policy CMP0146" for policy details. Use the cmake_policy command to
  4. set the policy and suppress this warning.
  5. This warning is for project developers. Use -Wno-dev to suppress it.

如上CMakeLists.txt的警告,不影响正常编译结束,但是可以让这个警告去掉,让编译输出更干净。主要是因为cmake政策的更新导致的,可以仍使用旧版本的政策。

解决方案:

在CMakeLists.txt的 find_package(CUDA) 前面加上如下内容:

  1. if(POLICY CMP0146)
  2. cmake_policy(SET CMP0146 OLD)
  3. endif()

如下: 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/很楠不爱3/article/detail/443853
推荐阅读
相关标签
  

闽ICP备14008679号