问题
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