DEV Community

Tuan Tu Tran
Tuan Tu Tran

Posted on

Build a project on Windows 11 using MinGW

Assuming that the CMakeLists.txt is located in the root folder of the project, follow these steps:

  • 1. Create a build folder:

mkdir build

  • 2. Change to the build folder:

cd build

  • 3. Use MinGW to generate the Makefile

cmake -G "MinGW Makefiles" ..

(The ".." at the end of the cmake command tellls it to look for the CMakeLists.txt file in the parent directory)

+4. Compile the project using mingw32-make:

mingw32-make

Reference:
[1]https://cmake.org/cmake/help/v3.12/generator/MinGW%20Makefiles.html

Top comments (0)