2012-11-27 32 views
1

的Zlib是應該在所有Mac的默認安裝我敢肯定。但是,當我爲SFML運行cmake我得到以下錯誤:MAC:丟失:ZLIB_INCLUDE_DIR && OPENGL_INCLUDE_DIR

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! 

回答

5

幫助的CMake通過設置ZLIB_INCLUDE_DIR變量來定位它。運行這個:

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

在您的構建目錄中,或通過GUI進行設置。

+0

不太清楚這是否會與這個項目特別工作,但我已經做了更多工作的CMake,這看起來像的東西我現在會做我有更多的經驗.. 希望別人這個問題認爲這有用 –