How do I tell cmake I want my project to link libraries statically?

后端 未结 7 588
暗喜
暗喜 2020-12-14 02:15

I\'m trying to build an OpenCV-based project using CMake, running on Linux. So far my CMakeLists.txt files looks something like

FIND_PACKAGE (Op         


        
7条回答
  •  悲哀的现实
    2020-12-14 02:33

    Actually this issue seems to have already been fixed in the OpenCVConfig.cmake that comes with OpenCV. All you have to do is define OpenCV_STATIC in your CMakeLists.txt. I.e.

    set(OpenCV_STATIC ON)
    find_package(OpenCV REQUIRED)
    

提交回复
热议问题