使用 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
添加的依賴。
具體的緣由應該是和 cmake
和 pkgconfig
的語法相關,經過查詢資料,獲得以下解決方案,親測可行: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