macos - MAC : missing: ZLIB_INCLUDE_DIR && OPENGL_INCLUDE_DIR

标签 macos opengl cmake zlib

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!

最佳答案

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

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

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

关于macos - MAC : missing: ZLIB_INCLUDE_DIR && OPENGL_INCLUDE_DIR,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13584619/

相关文章:

java - 在 macOS Catalina 上打开 PhpStorm 后崩溃

swift - NSAttributedString 绘制位置在 10.13 和 10.14+ 上不同

python - 为什么在 Mac 上键入括号时 Python 的 IDLE 会崩溃?

c++ - OpenGL 第一个立方体渲染不工作

c# - CMake - 将预建库链接到 C# 项目

c++ - CMake:如何更改子目录项目目标的属性?

macos - 错误 : Current platform "darwin 15" does not match expected platform "darwin 14

c++ - OpenGL : multiple VAOs for one VBO

c++ - 点集上的 2d 旋转会导致倾斜失真

c++ - CMake 项目中的 qmake 子项目