C++ 我犯了我不明白的错误

C++ 我犯了我不明白的错误,c++,opengl,cmake,glfw,C++,Opengl,Cmake,Glfw,我正在使用CMake编译一个项目。这是指向我的源的路径:。当我打这个的时候 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 correct

我正在使用CMake编译一个项目。这是指向我的源的路径:。当我打这个的时候

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".
你能解释一下如何修正这个错误吗? 提前谢谢

您错误地使用了该命令:

PROJECT(OpenGL Snake)
空间充当分隔符。这意味着项目名称是
OpenGL
,语言是
Snake
。克马克不懂这种语言

将代码更改为

PROJECT(OpenGL_Snake)

项目名称中有一个空格:
project(openglsnake)
。看——这使得
Snake
成为语言参数。@DanMašek谢谢!当我删除空间时,它会工作。如果原始的
CMakeLists.txt
被放在问题中,对未来的读者会有好处。外部链接现在包含已更正的版本。