[CMake] how to build cmake with mingw and msys?

Bill Hoffman bill.hoffman at kitware.com
Thu Aug 16 09:32:44 EDT 2012


On 8/16/2012 1:47 AM, Alan W. Irwin wrote:
>
> Bill, you are the chief guru here so I am a bit hesitant to correct
> you. :-) However, I just checked a fairly recently downloaded version
> of MinGW/MSYS I use for my Wine experiments using the following
> command:
OK, I was wrong... If we look at the error message closer, we can see he 
does have make.exe.  In fact, the bootstrap cmake builds.  When it tries 
to use that bootstrapped cmake is when it fails.  The output is here:



  Run Build Command:C:/MinGW/msys/bin/make.exe
   "cmTryCompileExec2155929314/fast"

   make -f CMakeFiles/cmTryCompileExec2155929314.dir/build.make
   CMakeFiles/cmTryCompileExec2155929314.dir/build

     make: make: Command not found


So, that tells me something goes wrong with the PATH maybe.

It runs C:/MinGW/msys/bin/make.exe

Then inside the cmake generated makefile it does this:

$(MAKE) -f somemakefile

At this point MAKE= make, and make is not found.

You should be able to reproduce this with a simple makefile setup like this:

-----Makefile-----
foo:
       $(MAKE) -f foo.make

----foo.make----
all:
       echo "foo bar"

So, the C:/MinGW/msys/bin/make.exe make is setting MAKE to be make.  You 
don't perhaps have an environment variable MAKE set to make do you?  Is 
C:/MinGW/msys/bin/ in your PATH?

You could also try a makefile like this:
all:
      echo $(PATH)
      echo $(MAKE)

-Bill




More information about the CMake mailing list