OpenCV as a static library (cmake options)

前端 未结 1 1151
谎友^
谎友^ 2020-12-01 06:07

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 option

相关标签:
1条回答
  • 2020-12-01 06:33

    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.

    0 讨论(0)
提交回复
热议问题