I have reached the end of my rope with CMake; it has so much potential, but I cannot seem to make it find the basic system tools (i.e. make
) in order to function.
CMake and the CMake GUI produce the following (after deleting the CMakeCache.txt file):
Processing top-level CMakelists.txt for project swb
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.
I am focusing on finding make
in this question, however, I've also had many of the same issues with CMake failing to find libraries and other utility files (linker, nm, ar, etc.). The techniques I list below seem to enable CMake to find these files when running under Linux.
Windows 7 (64-bit); multiple versions of MinGW (32-bit/64-bit); Cmake 2.8.4; NONSTANDARD install location for MinGW (c:/MinGW-32 ).
CMakelists.txt contains SET( CMAKE_MAKE_PROGRAM c:/MinGW-32/bin/make.exe FORCE )
within the first 10 lines of the file.
Previous versions of CMakelists.txt contained:
find_program(CMAKE_MAKE_PROGRAM
NAMES make
make.exe
DOC "Find a suitable make program for building under Windows/MinGW"
HINTS c:/MinGW-32/bin )
Set CMAKE_MAKE_PROGRAM
in a cmd.exe environment variable prior to running either CMake or CMake-GUI.
Use of a "toolchain" file which identifies CMAKE_MAKE_PROGRAM
as well as CMAKE_C_COMPILER
, etc.
CMake will successfully create build files IF I use the GUI to populate the CMAKE_MAKE_PROGRAM
variable ("C:/MinGW-32/bin/make.exe").
I can get CMake to work if I identify the name of the make program via the GUI. How does one enable CMake to find my make program without user intervention with the Windows 7 (64-bit) / MinGW combination?
I have two suggestions:
Do you have make in your %PATH% environment variable? On my system, I need to add %MINGW_DIR%\bin to %PATH%.
Do you have make installed? Depending on your mingw installation, it can be a separate package.
Last resort: Can you pass the full path to make on the commandline? cmake -D"CMAKE_MAKE_PROGRAM:PATH=C:/MinGW-32/bin/make.exe" ..\Source