> > 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.k...@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 > >
-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers