【MLT编译问题】"PkgConfig:xml" includes non-existent path

使用 cmake .. 编译 mlt 框架时,遇到了如下问题:

CMake Error in src/modules/xml/CMakeLists.txt:
  Imported target "PkgConfig::xml" includes non-existent path

    "/usr/include/libxml2"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.

通过查看 mlt 中关于 libxml2 的配置可以发现在 CMakeLists.txt 中通过 pkgconfig 添加的依赖。
具体的原因应该是和 cmakepkgconfig 的语法相关,通过查询资料,得到如下解决方案,亲测可行:

  • 通过 brew info libxml2 查看 libxml2 的安装路径

    • 路径为:/usr/local/Cellar/libxml2/2.9.9_2
  • 打开该路径下的 lib/pkgconfig/libxml-2.0.pc 文件

    把
    includedir=${prefix}/include
    修改为
    includedir=${pc_sysrootdir}${prefix}/include

你可能感兴趣的:(ffmpeg,c,c++,音视频拼接)