Web lists-archives.com

Re: How to use CMake with cygwin/mingw toolchain?

On 2017-10-20 07:50, Peter Quiring wrote:
> What is the current process to use the mingw toolchain that is
> included with cygwin?

Treat it like any other cross-compiling scenario.

> There use to be a -mno-cygwin option used with gcc.

That was an ugly hack which never really worked correctly and which we
happily rid ourselves years ago.

> The mingw versions have x86_64-w64-mingw32- or i686-w64-mingw32- added
> to their exe names. Currently I just use these directly but I want to
> use cmake.
> Cygwin also includes cmake. How would I configure it to use the mingw
> toolset that is included with cygwin?

You need to provide a number of options, see:


> I also see some Qt5 *.cmake modules included in the Qt5 libraries for mingw.

Those, like all my packages, are built with cygport.

> Would it be possible to include a version of cmake built for mingw?

No, but you can create a CMake toolchain file with all the options so
that you don't have to specify them each time:



Attachment: signature.asc
Description: OpenPGP digital signature