I have trouble making CMake do its thing.

I have Win11 and am using MinGW for the c++ compiler. I have no Visual Studio.


The CMakeLists.txt file is :

set(CMAKE_MAKE_PROGRAM "C:/msys64/mingw64/bin/mingw32-make.exe")
set(CMAKE_C_COMPILER "C:/msys64/mingw64/bin/gcc.exe")
set(CMAKE_CXX_COMPILER "C:/msys64/mingw64/bin/g++.exe")

cmake_minimum_required(VERSION 3.0)


add_executable(Test1 test1.cpp)

The batch file I use to start everything is runMakers.bat :

mkdir build
cd build
cmake ..

in the runMakers.bat file I have distinctly not put in a run "mingw32-make" command

However, this is the error I receive when running this :

C:\CMake_Projects\Test1\build>cmake ..
-- Building for: NMake Makefiles <----------------------- very strange, I don't have Visula Studio and NMake
CMake Error at CMakeLists.txt:8 (project):

'C:/msys64/mingw64/bin/mingw32-make.exe' '-?'

failed with:

C:/msys64/mingw64/bin/mingw32-make.exe: invalid option -- ?

Usage: mingw32-make [options] [target] ...


-b, -m Ignored for compatibility.
-B, --always-make Unconditionally make all targets.
Change to DIRECTORY before doing anything.
-d Print lots of debugging information.
--debug[=FLAGS] Print various types of debugging information.
-e, --environment-overrides
Environment variables override makefiles.
-E STRING, --eval=STRING Evaluate STRING as a makefile statement.
-f FILE, --file=FILE, --makefile=FILE
Read FILE as a makefile.
-h, --help Print this message and exit.
-i, --ignore-errors Ignore errors from recipes.
Search DIRECTORY for included makefiles.
-j [N], --jobs[=N] Allow N jobs at once; infinite jobs with no arg.
-k, --keep-going Keep going when some targets can't be made.
-l [N], --load-average[=N], --max-load[=N]
Don't start multiple jobs unless load is below N.
-L, --check-symlink-times Use the latest mtime between symlinks and target.
-n, --just-print, --dry-run, --recon
Don't actually run any recipe; just print them.
-o FILE, --old-file=FILE, --assume-old=FILE
Consider FILE to be very old and don't remake it.
-O[TYPE], --output-sync[=TYPE]
Synchronize output of parallel jobs by TYPE.
-p, --print-data-base Print make's internal database.
-q, --question Run no recipe; exit status says if up to date.
-r, --no-builtin-rules Disable the built-in implicit rules.
-R, --no-builtin-variables Disable the built-in variable settings.
-s, --silent, --quiet Don't echo recipes.
--no-silent Echo recipes (disable --silent mode).
-S, --no-keep-going, --stop
Turns off -k.
-t, --touch Touch targets instead of remaking them.
--trace Print tracing information.
-v, --version Print the version number of make and exit.
-w, --print-directory Print the current directory.
--no-print-directory Turn off -w, even if it was turned on implicitly.
-W FILE, --what-if=FILE, --new-file=FILE, --assume-new=FILE
Consider FILE to be infinitely new.
--warn-undefined-variables Warn when an undefined variable is referenced.

This program built for Windows32

Report bugs to <bug-make@gnu.org>

-- Configuring incomplete, errors occurred!



It seems to want to run the mingw32-make.exe by itself and doesn't have the desired paramters.

Where do I write the parameters "-f makefile-that-cmake-constructed-please"

Thanks for any tips.