【问题标题】:MAC: missing: ZLIB_INCLUDE_DIR && OPENGL_INCLUDE_DIRMAC:缺少:ZLIB_INCLUDE_DIR && OPENGL_INCLUDE_DIR
【发布时间】:2012-11-27 12:49:17
【问题描述】:

默认情况下,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!

【问题讨论】:

    标签: macos opengl cmake zlib


    【解决方案1】:

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

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

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

    【讨论】:

    • 不太确定这是否特别适用于这个项目,但我已经做了更多的 cmake 工作,这看起来确实像我现在会做的事情我有更多的经验.. 希望其他人有这个问题发现这很有用
    猜你喜欢
    • 1970-01-01
    • 2016-04-06
    • 2013-09-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-14
    • 1970-01-01
    相关资源
    最近更新 更多