[CMake] cmake for cygwin

Marco Atzeri marco_atzeri at yahoo.it
Fri Oct 22 05:37:07 EDT 2010


--- 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

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



      


More information about the CMake mailing list