2015.06.24 19:33 "Re: [Tiff] CMake support for building libtiff", by Roger Leigh
On 24/06/2015 19:23, Rhys Thomas wrote:
On 24/06/2015 17:23, Bob Friesenhahn wrote:
The other three configurations (VS2008 64-bit, VS2012 32-bit and VS2012 64-bit) again do not compile out of the box on my "dirty" system. I get errors stating that "unistd.h" cannot be found, referenced from zconf.h in the GnuWin32 zlib installation. It does look like my installation of GnuWin32 is the reason behind this. I'm not sure what version I have. The version of zlib looks to be out-of-date, the header is copyright 1995-2005, whereas a later version that I have elsewhere is copyright 1995-2012 and this isn't the latest version. The old version contains a "#ifdef 1" in it, and this section is changed and commented out in the more recent version that I have. If I change the CMake options to point to the new version it compiles successfully. I successfully built and tested the VS2012 32-bit version with zlib support disabled (for some reason my zlib headers aren't all in the same directory) and a non-GnuWin32 version of libtiff.
How is CMake finding these installed files? Are they installed in the compiler's directory or in a system directory?
I would not expect CMake to search the system for installed packages but it could use them if the compiler finds them by default.
It is quite unwise to mix GnuWin32 code with MSVC code, particularly with newer MSVC versions.
I'm not sure of the exact mechanism that CMake is using, but it seems to be picking up "installed" files. Merely being present doesn't seem to be enough. It may be searching the Program FIles folders (where GnuWin32 was located) or looking for registry entries. It may be doing something else.
I haven't used GnuWin32 for any development for a long time. It just happened to be present on my system.
Looks like it is specifically checking for if gnuwin32 zlib is available using the registry.
Given that it's a simple C library, it's interesting that it's somehow incompatible with being used in an MSVC build, unless it's simply outdated and libtiff is requiring functionality only in a newer zlib.