我正在使用Cmake在OS X 10.9上构建QT项目。

自从Mavericks以来,OpenGL header 的位置似乎已更改。文件夹/System/Library/Frameworks/OpenGL.framework/Headers现在丢失了,cmake说

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中提供正确的路径,我尝试使用它们显然将 header 移动到Mavericks中的路径:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/OpenGL.framework/Headers

但是我仍然收到以下cmake错误:
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:

https://codereview.qt-project.org/#change,69605

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1fce189e

关于c++ - Qt 5和OS X Mavericks问题,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/19756694/

10-16 07:29