OpenCV as a static library (cmake options)

元气小坏坏 提交于 2019-11-26 13:09:19

问题


I want to use OpenCV library in an embedded system and I need to compile my project using OpenCV as a static library.

How can I create the library using cmake options ?


回答1:


To build OpenCV as static library you need to set BUILD_SHARED_LIBS flag to false/off:

cmake -DBUILD_SHARED_LIBS=OFF ..

But I think it is not enough for your task because you actually need to cross-compile library for you architecture. In case of Android or IOS such port already exists and you can simply use it. In case of another platform you need to create your own cmake toolchain file for cross-compiling and probably make a number of fixes in OpenCV build system.



来源:https://stackoverflow.com/questions/7583172/opencv-as-a-static-library-cmake-options

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