CMake找不到FindGLEW.cmake

时间:2015-03-30 06:41:51

标签: cmake cocos2d-x glew

Ubuntu12.04 的Cocos2D-X-3.4 当我建立测试项目时,有一些错误:

It appears you are builing natively for Linux with GCC
-- OpenGL include dirs: /usr/include
**CMake Error at cmake/Modules/CocosBuildHelpers.cmake:44** (find_package):
  **Could not find module FindGLEW.cmake or a configuration file for package
  GLEW**.

  Adjust CMAKE_MODULE_PATH to find FindGLEW.cmake or set GLEW_DIR to the
  directory containing a CMake configuration file for GLEW.  The file will
  have one of the following names:

    GLEWConfig.cmake
    glew-config.cmake

Call Stack (most recent call first):
  CMakeLists.txt:159 (cocos_find_package)

我检查了路径cmake/Modules/。没有FindGLEW.cmake个文件。但我不知道我能在哪里得到它,或者我如何解决这个问题。

3 个答案:

答案 0 :(得分:1)

  • 一些了解CMake的软件包提供了自己的Find * .cmake。例如,Eigen这样做。通过快速查看GLEW源代码,他们不会发送自己的查找包宏。

  • 有时,依赖外部库的项目会为外部依赖项发送自己的Find * .cmake。快速查看他们的存储库显示,他们既不发货。

但是CMake 2.8.10或更新版本包含测试,请参阅its documentation。该测试在3.1中有所改进。您可以更新CMake安装,它将起作用。

答案 1 :(得分:1)

我修好了。但是,我还没有清楚地理解它。 我创建了一个文件" FindGLEW.cmake"在路径" cmake / Modules" 该文件的内容就像网址所说的那样。 http://www-i8.informatik.rwth-aachen.de/svnrepo/OpenFlipper/branches/Free/cmake/FindGLEW.cmake

答案 2 :(得分:0)

我遇到了类似的问题,即cmake找不到“ FindGlew.cmake”,并出现以下错误: By not providing "FindGlew.cmake" in CMAKE_MODULE_PATH this project...

这很奇怪,因为我确实拥有该模块...仅将其称为FindGLEW.cmake(对于Fedora / Linux,它位于/usr/share/cmake/Modules/中。)

因此,我不得不使用FindGlew.cmake

链接到sudo ln -sf /usr/share/cmake/Modules/FindGLEW.cmake /usr/share/cmake/Modules/FindGlew.cmake

为了安全起见,我运行了一个简短的脚本,该脚本生成了FindGlew中大写和小写字母的所有排列的列表,并建立了所有链接的链接。在处理浪费时间的程序员时,只是为了创建更大更好的make而已。是的...

p.s。如果系统中不存在FindGLEW.cmake,则需要升级cmake和/或安装其他模块glew-devel