【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 的语法相关,经过查询资料,获得以下解决方案,亲测可行:ide

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

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

    把
    includedir=${prefix}/include
    修改成
    includedir=${pc_sysrootdir}${prefix}/include
相关文章
相关标签/搜索