问题描述
我使用Cmake在OS X 10.9上构建一个QT项目。
I'm using Cmake to build a QT project on OS X 10.9.
自Mavericks以来,OpenGL头文件的位置似乎已经改变了。 /System/Library/Frameworks/OpenGL.framework/Headers
文件夹现在缺失,cmake说
Since Mavericks, the location of the OpenGL headers seems to have changed. The folder /System/Library/Frameworks/OpenGL.framework/Headers
is missing now, and cmake says
CMake Error at /Applications/Qt/5.1.1/clang_64/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:8 (message):
Failed to find "gl.h" in
"/System/Library/Frameworks/OpenGL.framework/Headers"
"/System/Library/Frameworks/AGL.framework/Headers""."
并要求我在此变量中提供正确的路径 _qt5gui_OPENGL_INCLUDE_DIR
,我尝试了他们显然把标题移动到小牛的路径:
and asks me to provide the correct path in this variable _qt5gui_OPENGL_INCLUDE_DIR
, which I tried with the path they apparently moved the headers to in Mavericks:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/OpenGL.framework/Headers
但我仍然得到以下cmake错误:
But I still get the following cmake error:
CMake Error at /Applications/Qt/5.1.1/clang_64/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:15 (message):
The imported target "Qt5::Gui" references the file
"/System/Library/Frameworks/OpenGL.framework/Headers"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
"/Applications/Qt/5.1.1/clang_64/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake"
but not all the files it references.
Call Stack (most recent call first):
/Applications/Qt/5.1.1/clang_64/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:57 (_qt5_Gui_check_file_exists)
/Applications/Qt/5.1.1/clang_64/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:64 (_qt5gui_find_extra_libs)
/Applications/Qt/5.1.1/clang_64/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:123 (include)
CMakeLists.txt:40 (find_package)
推荐答案
您需要Qt 5.2和CMake 2.8.12:
You need Qt 5.2 and CMake 2.8.12:
这篇关于Qt 5和OS X Mavericks问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!