CMake错误,我不明白

时间:2016-03-20 17:36:50

标签: c++ opengl cmake glfw

我正在使用CMake编译项目。这是我的来源的路径:https://github.com/Ro6afF/Snake。当我输入这个

cd build && cmake ..

打印出来:

CMake Error: Could not find cmake module file: CMakeDetermineSnakeCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_Snake_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_Snake_COMPILER
CMake Error: Could not find cmake module file: /home/asd/snake/build/CMakeFiles/3.5.0/CMakeSnakeCompiler.cmake
CMake Error at CMakeLists.txt:3 (Project):
  No CMAKE_Snake_COMPILER could be found.

  Tell CMake where to find the compiler by setting the CMake cache entry
  CMAKE_Snake_COMPILER to the full path to the compiler, or to the compiler
  name if it is in the PATH.


CMake Error: Could not find cmake module file: CMakeSnakeInformation.cmake
CMake Error: CMAKE_Snake_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "/home/asd/snake/build/CMakeFiles/CMakeOutput.log".

你能解释一下如何解决这个错误吗? 提前谢谢!

1 个答案:

答案 0 :(得分:3)

您错误地使用project命令:

PROJECT(OpenGL Snake)

空格充当分隔符。这意味着项目名称为OpenGL,语言为Snake。 CMake不懂这种语言。

将代码更改为

PROJECT(OpenGL_Snake)