找不到 Pixman - Cmake 错误

Could not find Pixman - Cmake error

我正在使用 cmake Gui 构建 Cairo。 当我点击 'configure' 时,Cmake 显示以下错误:

Could NOT find PIXMAN, try to set the path to PIXMAN root folder in the system variable PIXMAN (missing: PIXMAN_LIBRARIES PIXMAN_INCLUDE_DIRS)
Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
CMake Error at C:/cmake-3.7.0-rc1-win32-x86/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
Call Stack (most recent call first):
C:/cmake-3.7.0-rc1-win32-x86/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
C:/cmake-3.7.0-rc1-win32-x86/share/cmake-3.7/Modules/FindPNG.cmake:146 (find_package_handle_standard_args)
CMakeLists.txt:7 (find_package)

我已经下载了Zlib、LibPng、Pixman源文件。 这些文件放在哪里? 我认为 FindPixaman.cmake 文件需要修改:

 # PIXMAN_ROOT_DIR - Set this variable to the root installation of PIXMAN

如何将 PIXMAN_ROOT_DIR 的路径设置为 root 安装?

I think FindPixaman.cmake file needs to be modified

永远不要修改包文件。你应该做的是在调用 find_package 之前在你的 cmake 项目中设置变量 PIXMAN_ROOT_DIR 这样包就会知道在哪里搜索:​​

set(PIXMAN_ROOT_DIR /path/to/pixman)

其中/path/to/pixman是pixman的安装目录。查看 package file,它应该包含子目录 includelib,分别包含 pixman.h 和编译的库。

或者您可以在 gui 中使用按钮 Add entry:

设置 PIXMAN_ROOT_DIR