This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


I also found just setting CC and CXX environment variables pointing to
the mingw gcc works.

Thanks for the links.

On Fri, Oct 20, 2017 at 5:11 PM, Yaakov Selkowitz <yselkowitz@cygwin.com> wrote:
> 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:
>
> https://github.com/cygwinports/cygport/blob/master/cygclass/cmake.cygclass#L137
>
>> 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:
>
> https://cmake.org/Wiki/CMake_Cross_Compiling
>
> --
> Yaakov
>



-- 
Peter Quiring

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]