当前位置:   article > 正文

CMake Warning (dev) at cmake/OpenCVDetectPython.cmake:140 (find_package): Policy CMP0148 is not set_policy cmp0148 is not set: the findpythoninterp an

policy cmp0148 is not set: the findpythoninterp and findpythonlibs modules a

1、原文

opencv编译的时候

  1. CMake Warning (dev) at cmake/OpenCVUtils.cmake:144 (find_package):
  2. Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
  3. are removed. Run "cmake --help-policy CMP0148" for policy details. Use
  4. the cmake_policy command to set the policy and suppress this warning.`
  5. Call Stack (most recent call first):
  6. cmake/OpenCVDetectPython.cmake:64 (find_host_package)
  7. cmake/OpenCVDetectPython.cmake:271 (find_python)
  8. CMakeLists.txt:643 (include)
  9. This warning is for project developers. Use -Wno-dev to suppress it.
  10. CMake Warning (dev) at cmake/OpenCVUtils.cmake:144 (find_package):
  11. Policy CMP0146 is not set: The FindCUDA module is removed. Run "cmake --help-policy CMP0146" for policy details. Use the cmake_policy command to
  12. set the policy and suppress this warning.`
  13. Call Stack (most recent call first):
  14. cmake/OpenCVDetectCUDA.cmake:21 (find_host_package)
  15. cmake/OpenCVFindLibsPerf.cmake:43 (include)
  16. CMakeLists.txt:750 (include)
  17. This warning is for project developers. Use -Wno-dev to suppress it.

2、说明

报错的意思是cmake的规则没有被设置,之前的过时了。可参考https://cmake.org/cmake/help/latest/policy/CMP0148.html

3、解决

在OpenCVDetectPython.cmake添加下面内容即可。

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

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

闽ICP备14008679号