[CMake] cmake for cygwin

Hendrik Sattler post at hendrik-sattler.de
Sun Oct 24 04:12:09 EDT 2010


Am Sonntag 24 Oktober 2010, 08:37:30 schrieb Marco Atzeri:
> It should be changed. That will be the cleanest way for porting and
> most of the time we will not need any IF (CYGWIN) to complete our job
> as package maintainer.
> 
> Othewise we should patch any sources to replace IF (WIN32) with
> IF(WIN32 AND NOT CYGWIN) and these means that this wrong policy
> is forcing unneeded workload on our backs.
> 
> Also cmake and vtk sources are full of IF(WIN32 AND NOT CYGWIN)
> because WIN32 and CYGWIN are in strong contrast.

No, they are not. There are certain things in cygwin that are so WIN32 like.
I have the following in my CMakeLists for OpenOBEX:
if ( CMAKE_COMPILER_IS_GNUCC )
  if ( UNIX AND NOT WIN32 )
    set ( COMPILER_FLAG_VISIBILITY -fvisibility=hidden )
    check_c_compiler_flag ( ${COMPILER_FLAG_VISIBILITY}
                            COMPILER_SUPPORT_VISIBILITY )
  endif ( UNIX AND NOT WIN32 )
[...]

because on WIN32, the DLLEXPORT is used instead. So your proposal really 
breaks working setups while trying to fix it for those upstreams that cannot 
read documentation? That sucks.

And: believe it or not, WIN32 and CYGWIN are _not_ in strong contrast. They've 
got so much in common, starting from the binary file format to all low level 
stuff that cygwin is never going to change. Live with it.

HS


More information about the CMake mailing list