2

默认情况下,Zlib 应该安装在所有 mac 上,我很确定.. 但是当我为 SFML 运行 cmake 时,我收到以下错误:

The C compiler identification is Clang 4.1.0
The CXX compiler identification is Clang 4.1.0
Check for working C compiler using: Xcode
Check for working C compiler using: Xcode -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler using: Xcode
Check for working CXX compiler using: Xcode -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Found OpenGL: /System/Library/Frameworks/OpenGL.framework
Found Freetype: /usr/X11R6/lib/libfreetype.dylib (found version "2.4.4")
Found GLEW: /Users/falconmick/Documents/SFML2 src/extlibs/libs-osx/lib/libGLEW.a
Found JPEG: /Users/falconmick/Documents/SFML2 src/extlibs/libs-osx/lib/libjpeg.a
CMake Error at /Applications/CMake 2.8-10.app/Contents/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:97 (message):
Could NOT find ZLIB (missing: ZLIB_INCLUDE_DIR)
Call Stack (most recent call first):
/Applications/CMake 2.8-10.app/Contents/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:291 (_FPHSA_FAILURE_MESSAGE)
/Applications/CMake 2.8-10.app/Contents/share/cmake-2.8/Modules/FindZLIB.cmake:85 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
src/SFML/Graphics/CMakeLists.txt:85 (find_package)


CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
OPENGL_INCLUDE_DIR (ADVANCED)
used as include directory in directory /Users/falconmick/Documents/SFML2 src/src/SFML/Window

Configuring incomplete, errors occurred!
4

1 回答 1

5

ZLIB_INCLUDE_DIR通过设置变量帮助 CMake 找到它。要么运行这个:

cmake -D ZLIB_INCLUDE_DIR=/path/to/zlib/include .

在您的构建目录中,或通过 GUI 设置它。

于 2012-11-27T16:24:36.277 回答