[CMake] mingw vs MSYS makefiles

Bill Hoffman bill.hoffman at kitware.com
Thu Feb 23 16:02:06 EST 2012


On 2/23/2012 3:40 PM, Kenneth Boyd wrote:
> On 2/23/2012 1:46 PM, Bill Hoffman wrote:

> Right. Unfortunately, I have MingW installed from official tarballs,
> rather than the MSYS executable installer; the MSYS installer *.exe
> critically failed for me back in 2001, so once I got a working install
> procedure from official tarballs I stuck with it.
>
> What is happening is that I have an official MingW /bin/sh in my path
> (which triggers MSYS), but the pathnames required by windows-side tools
> such as MingW32 gcc are still Windows-ish (MingW).

AFAIK, if /bin/sh is in your PATH gmake goes into shell mode and you can 
not use windows style shell stuff in the makefile.  If you take out the 
check that I put in, it should fail in some other way.  I put the check 
in early with a message to avoid people getting the weird errors later.
>
>> It does seem that there is an issue with allowing make.exe to work.
>> I think if you set CMAKE_MAKEPROGRAM to make.exe it should work.
> Ok.
>> A patch that found different make.exe or make-mingw and then tested
>> them would not be rejected. I still don't see how we can avoid having
>> separate generators for MinGW and Msys, and I certainly don't think a
>> third one would help reduce confusion.
> I'm assuming that the Msys generator is intended for the results of the
> MSYS installer *.exe . As such, I'd prefer to assume the current MSYS
> generator is known-good for that case. My impression (please correct if
> inaccurate) is that it would be preferable to have the final patch
> augment the MSYS generator to discern which filepath convention is
> expected.
I don't see what case your 3rd generator will handle.  Seems to me there 
are only two cases regardless of how it was installed:

1. you have /bin/sh in your PATH and gmake runs commands via /bin/sh
2. you do not have /bin/sh in your PATH and gmake runs commands via the 
native windows shell.

I wonder if the plain "Unix Makefiles" generator would work for you?


-Bill


More information about the CMake mailing list