[CMake] CMAKE - troubles finding executables/paths - Windows 7 / MinGW

Steve Westenbroek smwesten at usgs.gov
Tue May 31 12:08:37 EDT 2011


[disclaimer: portions of the text below is from an earlier contribution 
that I made to stackoverflow.com; I'll cross-post any solutions as well!]

Greetings,

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.

SYMPTOMS

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.

SYSTEM

Windows 7 (64-bit); multiple versions of MinGW (32-bit/64-bit); Cmake 
2.8.4; NONSTANDARD install location for MinGW (c:/MinGW-32 ).

THINGS I HAVE TRIED

1) CMakelists.txt contains "SET( CMAKE_MAKE_PROGRAM 
c:/MinGW-32/bin/make.exe FORCE )" within the first 10 lines of the file.

2) 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 )

3) Set CMAKE_MAKE_PROGRAM in a cmd.exe environment variable prior to 
running either CMake or CMake-GUI.

4) Use of a "toolchain" file which identifies CMAKE_MAKE_PROGRAM as well 
as CMAKE_C_COMPILER, etc.

QUESTION(S)

How does one enable CMake to find my make program without user 
intervention with the Windows 7 (64-bit) / MinGW combination? Nothing I 
have tried thus far seems to make any difference; Cmake simply is unable 
to find "make.exe" even when explicitly given the fully qualified name.

Thanks!

  - Steve Westenbroek


More information about the CMake mailing list