[cmake-developers] [PATCH] CMakeDetermineSystem.cmake distinguishes-MSYS-MINGW32 (was Re: Distinguishing MSYS2

Greg Jung gvjung at gmail.com
Mon Aug 10 16:07:15 EDT 2015


>
> We need to distinguish between the original "MSYS" and "MSYS2" for
> purposes of this discussion.  IIUC MSYS2 is a full environment
> like Cygwin.  In the "Distinguishing MSYS2" thread we established
> that CMake should be built for running under MSYS2 and link to
> the msys-2.0.dll runtime in order to generate build systems for
> MSYS2 targets.  In this case there should be no "MinGW Makefiles"
> or "MSYS Makefiles" generators.  It should just be "Unix Makefiles"
> with CMAKE_SYSTEM_NAME set to "MSYS" (or "MSYS2"?).


There is an msys2-specific cmake version already built along those lines,
with several patches in the modules section to parallel the CYGWIN cases,
in the msys2 distribution.  It does not have
a "MSYS Makefiles" generator option but uses "Unix generator"  as you
anticipate.  When CmakeDetermineSystem is invoked, it has both MSYS and
CMAKE_HOST_UNIIX set.

CMAKE_HOST_UNIX is set and maintained.
CMAKE_HOST_WIN32 is unset (as for Cygwin)
FindMsys.cmake, CPACKMsys.cmake, etc. modules


It is possible, if there is no cmake in the path until /usr/bin/cmake, to
accidentally run cmake for msys2 where a native cmake (installed under
/mingw32 or vers.>=3.3) was appropriate.  The user would need to specify
"Unix Makefiles" to get very far in this folly because "MSYS Makefiles"
would be kicked back.

On Mon, Aug 10, 2015 at 6:45 AM, Brad King <brad.king at kitware.com> wrote:

> On 08/07/2015 09:47 PM, Greg Jung wrote:
> > Here is a patch that incorporates mingw/msys run via "MSYS Makefiles"
> > generator to obtain the system name via "uname -s".
>
> Thanks.  Is this meant for use when running on MSYS2?  Is
> "#if defined(__MSYS__)" the official preprocessing condition for
> targeting the MSYS2 runtime platform?
>
> We need to distinguish between the original "MSYS" and "MSYS2" for
> purposes of this discussion.  IIUC MSYS2 is a full environment
> like Cygwin.  In the "Distinguishing MSYS2" thread we established
> that CMake should be built for running under MSYS2 and link to
> the msys-2.0.dll runtime in order to generate build systems for
> MSYS2 targets.  In this case there should be no "MinGW Makefiles"
> or "MSYS Makefiles" generators.  It should just be "Unix Makefiles"
> with CMAKE_SYSTEM_NAME set to "MSYS" (or "MSYS2"?).
>
> The "MSYS Makefiles" generator should remain unaware of MSYS2
> as distinct from the original MSYS.  In both cases one is using
> MinGW tools to build native Windows binaries.  This generator
> should be available only when CMake is built to host natively
> on Windows.  CMAKE_SYSTEM_NAME should still be "Windows".  It
> just happens to generate for the MSYS make tool.
>
> -Brad
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150810/ef1c6cdf/attachment.html>


More information about the cmake-developers mailing list