将OPENCV作为CMAKE项目的一部分编译

发布于 2025-01-29 00:02:12 字数 386 浏览 1 评论 0原文

如何作为项目的一部分编译CMAKE源代码。假设我在我的app/exters目录中从github克隆了openCV,并且有一个可执行文件,则以/app/main.cpp的速度使用。 Cmake的find_package()find_library()命令不起作用,因为我只有源代码,并且想使用我的应用程序开始对OpenCV进行编译。

我知道有关将OpenCV链接到可执行文件的其他简单方法,但我想以这种方式为此项目做。所有建议都受到欢迎。

项目结构就像

/app
  /external
    /opencv
  main.cpp
  CMakeLists.txt

How can I compile Cmake source code as part of my project. Say I cloned opencv from github in my app/external directory and there is one executable as /app/main.cpp. CMake's find_package() and find_library() commands does not works because I only have the source code and want to start compiling process of opencv with my app.

I am aware of there are other easy methods about linking opencv to executable but I want do at this way for this project. All suggestions are welcomed.

project structure be like

/app
  /external
    /opencv
  main.cpp
  CMakeLists.txt

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文