[CMake] cmake for cygwin

David Cole david.cole at kitware.com
Fri Oct 22 09:05:28 EDT 2010


On Fri, Oct 22, 2010 at 5:37 AM, Marco Atzeri <marco_atzeri at yahoo.it> wrote:

> --- Ven 22/10/10, Michael Wild  ha scritto:
>
> >
> > On 22. Oct, 2010, at 11:07 , Marco Atzeri wrote:
> >
> > > Dear developers,
> > > the current cmake package for cygwin is unsuitable to
> > build
> > > cmake package as it defines WIN32.
> > > Cygwin programs are unix-like ones while WIN32 is
> > needed only
> > > for pure windows programs.
> > > Defining WIN32 breaks building normal unix programs.
> > >
> > > To build the last qhull package
> > > http://cygwin.com/ml/cygwin-announce/2010-09/msg00015.html
> > > I was obliged to use the cmake Ports version.
> > >
> > >
> http://cygwin-ports.git.sourceforge.net/git/gitweb.cgi?p=cygwin-ports/ports;a=tree;f=devel/cmake;hb=HEAD
> > >
> > > Using such package I was also able to build VTK, with
> > very minor
> > > change of the source.
> > > http://www.vtk.org/pipermail/vtk-developers/2010-September/008590.html
> > >
> > >
> > > As the first target of a cygwin package is to allow
> > to
> > > build other cygwin packages, the current package
> > > does NOT satisfy this requirement.
> > >
> > > Regards
> > > Marco
> >
> > That's why one should check for CYGWIN in the
> > CMakeLists.txt files. IMHO this is a user-error and not
> > CMake's fault. The doc clearly states about the WIN32
> > variable:
> >
> >        WIN32  True on windows
> > systems, including win64.
>
> But for cygwin is WRONG. It should be false
>


This depends on your perspective. Are you using cygwin to try to make a
native Windows port of a Unix program, or are you simply trying to compile
the Unix program as if it was still Unix (and thereby trap it in the cygwin
environment)?

We have been used to people saying they want to build native Windows apps
with cygwin... and that's why it is the way it is. Perhaps there would be
less cygwin-angst in the cmake world if we had adopted the opposite
perspective, but that's the way it's been.

If we change it now, it should be changed via a cmake policy so that it's
easy to get both behaviors for a while...



>
> WIN32 in not defined when you compile for cygwin any
> package.
> It is defined if your target is non cygwin but a pure
> win32 program like mingw ones.
> Eg. Autoconf/Automake don't set WIN32.
>
> Checking for CYGWIN in the CMakeLists.txt
> oblige to modify upstream source for any package
> we want to port on cygwin. While not setting WIN32
> allow to use upstream source without change and building
> like any other Unix system.
>
> >
> >               Set to
> > true when the target system is Windows and on cygwin.
> >
> > Michael
>
>
> Marco
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20101022/c4bff78d/attachment.htm>


More information about the CMake mailing list