当前位置:   article > 正文

TODO:windows下vs2013+cmake源码安装opencv3.2.0_cmake deprecation warning at cmakelists.txt:81 (cm

cmake deprecation warning at cmakelists.txt:81 (cmake_policy): the old behav

最近开始折腾opencv了,先用它来做一些简单的功能实现,然后再深入算法一探究竟。

当然,天才第一步,环境最先布。

准备:

1、下载opencv3.2.0源码,我们可以在opencv官网上下载,或者直接百度搜索opencv3.2.0,我都给各位准备好了

2、下载cmake工具,下载地址,下载最新版3.12就可以

第一步:

1、cmake安装

将下载好的压缩包直接解压到你想放的路径下面

然后将bin目录加入到系统环境变量

控制面板-->系统和安全-->高级设置-->设置环境变量-->系统变量

找到PATH后双击,选择添加 D:\cmake-3.12.0-win32-x86\bin(以D盘为例,添加的是你的对应文件夹的路径,用英文分号;和前面的内容隔开。)

这里不需要重启生效,直接添加完成之后就可以用哦。

2、opencv安装

2.1 源码安装方式:

上面第一步将Cmake的bin文件夹加入到环境变量生效以后,直接在cmd里面输入cmake-gui然后回车就可以直接打开cmake了。(这里我使用的是Cmder,界面会比windows自带的cmd界面友好一些,而且可以加入右键菜单直接打开,类似于Ubuntu的Terminal,很方便,推荐大家使用,具体安装方法参见

cmder安装  提醒:按照上面的方式将D:\cmder_mini添加到环境变量。

Cmder 加入右键菜单:win+r打开运行之后输入cmder,进入cmder后命令行执行Cmder.exe /REGISTER ALL即成功添加到右键菜单)

如上图步骤:

1)首先选择source code的路径,就是上面的opencv-3.2.0、

2)手动在opencv-3.2.0里面建一个名字为 build 的文件夹,把 build 文件夹的路径加到这步

3)点击 Configue

4)就会弹出一个选择编译器的界面,选择自己对应的VS版本就行了。

5)点击Finish

文件就开始编译了,第一次编译的话会下载一些依赖的东西,所以需要多等一会。会有如下生成:

  1. CMake Deprecation Warning at CMakeLists.txt:72 (cmake_policy):
  2. The OLD behavior for policy CMP0020 will be removed from a future version
  3. of CMake.
  4. The cmake-policies(7) manual explains that the OLD behaviors of all
  5. policies are deprecated and that a policy should be set to OLD only under
  6. specific short-term circumstances. Projects should be ported to the NEW
  7. behavior and not rely on setting a policy to OLD.
  8. CMake Deprecation Warning at CMakeLists.txt:76 (cmake_policy):
  9. The OLD behavior for policy CMP0022 will be removed from a future version
  10. of CMake.
  11. The cmake-policies(7) manual explains that the OLD behaviors of all
  12. policies are deprecated and that a policy should be set to OLD only under
  13. specific short-term circumstances. Projects should be ported to the NEW
  14. behavior and not rely on setting a policy to OLD.
  15. CMake Deprecation Warning at CMakeLists.txt:81 (cmake_policy):
  16. The OLD behavior for policy CMP0026 will be removed from a future version
  17. of CMake.
  18. The cmake-policies(7) manual explains that the OLD behaviors of all
  19. policies are deprecated and that a policy should be set to OLD only under
  20. specific short-term circumstances. Projects should be ported to the NEW
  21. behavior and not rely on setting a policy to OLD.
  22. The CXX compiler identification is MSVC 18.0.21005.1
  23. The C compiler identification is MSVC 18.0.21005.1
  24. Check for working CXX compiler: D:/VS2013/VC/bin/cl.exe
  25. Check for working CXX compiler: D:/VS2013/VC/bin/cl.exe -- works
  26. Detecting CXX compiler ABI info
  27. Detecting CXX compiler ABI info - done
  28. Detecting CXX compile features
  29. Detecting CXX compile features - done
  30. Check for working C compiler: D:/VS2013/VC/bin/cl.exe
  31. Check for working C compiler: D:/VS2013/VC/bin/cl.exe -- works
  32. Detecting C compiler ABI info
  33. Detecting C compiler ABI info - done
  34. Detecting C compile features
  35. Detecting C compile features - done
  36. Performing Test HAVE_CXX_FSIGNED_CHAR
  37. Performing Test HAVE_CXX_FSIGNED_CHAR - Failed
  38. Performing Test HAVE_C_FSIGNED_CHAR
  39. Performing Test HAVE_C_FSIGNED_CHAR - Failed
  40. FP16: Compiler support is available
  41. Check if the system is big endian
  42. Searching 16 bit integer
  43. Looking for sys/types.h
  44. Looking for sys/types.h - found
  45. Looking for stdint.h
  46. Looking for stdint.h - found
  47. Looking for stddef.h
  48. Looking for stddef.h - found
  49. Check size of unsigned short
  50. Check size of unsigned short - done
  51. Using unsigned short
  52. Check if the system is big endian - little endian
  53. Looking for fseeko
  54. Looking for fseeko - not found
  55. Looking for unistd.h
  56. Looking for unistd.h - not found
  57. Check size of off64_t
  58. Check size of off64_t - failed
  59. Looking for assert.h
  60. Looking for assert.h - found
  61. Looking for fcntl.h
  62. Looking for fcntl.h - found
  63. Looking for io.h
  64. Looking for io.h - found
  65. Looking for jbg_newlen
  66. Looking for jbg_newlen - not found
  67. Looking for mmap
  68. Looking for mmap - not found
  69. Looking for search.h
  70. Looking for search.h - found
  71. Looking for string.h
  72. Looking for string.h - found
  73. Looking for unistd.h
  74. Looking for unistd.h - not found
  75. Downloading opencv_ffmpeg.dll...
  76. Downloading opencv_ffmpeg.dll... Done
  77. Downloading opencv_ffmpeg_64.dll...
  78. Downloading opencv_ffmpeg_64.dll... Done
  79. Downloading ffmpeg_version.cmake...
  80. Downloading ffmpeg_version.cmake... Done
  81. ICV: Downloading ippicv_windows_20151201.zip...

然后就会得到下面的界面:

这里根据自己的需求勾选自己需要的选项或者消去自己不需要的选项就可以了,选择完成后点击 Configure 旁边的 Generate ,这个过程很快,最后会得到:

后续步骤参考以下链接:https://blog.csdn.net/chris_zhangrx/article/details/79090463

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

闽ICP备14008679号