CMake: How to only include part of OpenCV?

♀尐吖头ヾ 提交于 2021-02-07 14:41:50

问题


When I use CMake with FIND_PACKAGE( OpenCV REQUIRED ), all components of OpenCV get included and all libs linked, and all paths show up in include dirs in VS. However, since OpenCV 2, every part of the lib can be included and linked to on its own. So if my project only uses the "core" and "imgproc" part of OpenCV, I dont want to bloat my project (and project files) by linking to all of OpenCV. Is it possible to only include part of it in CMake?


回答1:


Since OpenCV 2.4.0 it is as simple as:

 FIND_PACKAGE( OpenCV REQUIRED core imgproc)


来源:https://stackoverflow.com/questions/11196720/cmake-how-to-only-include-part-of-opencv

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!