Cmake error when building GLFW

I downloaded the GLFW sources and started building, chose the mingw makefiles configuration and an error appeared:

CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
  cmake_minimum_required() should be called prior to this top-level project()
  call.  Please see the cmake-commands(7) manual for usage documentation of
  both commands.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 4.0)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".


Configuring incomplete, errors occurred!

How to solve this?

This feels like a question you may want to ask on the GLFW forums.
Given that the top level GLFW CMakeLists.txt does contain a project command I suspect you’ve invoked cmake with incorrect paths. You’d have to provide information on where your GLFW sources are, where your build directory is, and how you’ve invoked cmake to be sure.


In photographs of the way.

Снимок экрана 2025-02-24 223709

“Where is the source code” should point at the highest level directory that contains a CMakeLists.txt, in this case that should be the one that contains src/, include/, and CONTRIBUTERS.md among others.
If cmake wrote any files to your build directory you may want to remove those, so it does not pick up any cached info from your previous build attempt.

Thank you!//////////////////////////////////////////////////////