2015.06.19 13:53 "Re: [Tiff] CMake support for building libtiff", by Rhys Thomas
I have now completed the conversion and I have attached a set of patches to add CMake support (against the 4.0.4 beta release). This has been tested on the following platforms:
- FreeBSD 10.1 / clang 3.4
- Linux (Ubuntu 15.04) / gcc 4.9
- MacOS X (10.10 with homebrew) / clang 3.5
- Windows (Visual Studio 2015 RC) / MSVC18
Note that I converted the shell-based testcases to use CMake natively. This means you can run all the unit tests on Windows for the first time (and they all pass).
Caveat: Visual Studio 2013 and earlier don't provide snprintf(3). libtiff builds but the tests and tools do not all build; unless there's a workaround, I'll need to selectively disable building of the tools and tests when using these versions.
I'd be very interested in any feedback, particularly from Windows users.
I'll follow up with a patch to disable the non-buildable components
tomorrow; you can just comment out the test/tools/contrib directories in the top-level CMakeLists.txt in the interim.
I have applied the previously attached patches to 4.0.4beta and tried a number of different configurations under Windows 7. On each occasion I did not change any of the settings available in CMake.
On my main Windows 7 machine I have tried to build on Visual Studio 2008 and 2012 (32 and 64 bit targeted on both, tried Debug and Release configurations) and have been unsuccessful in my attempts to build. The error messages seem to suggest that some header files are missing/inaccessible on my system (unistd.h being one of them). I have a lot of extra stuff set up in my Include and Library paths, including some parts of GnuWin32 which seems to be where the errors are coming from (zconf.h being one such source). Disabling Win32 file IO in CMake gets rid of a few of these errors.
On a clean Visual Studio 2012 installation on another machine the results are much better: on all of the configurations that I tried (32/64 bit, Debug/Release) all but eight of the projects built successfully (is this the same number that you found? I did not comment out the lines that you suggested). I have not yet identified the projects that did not build correctly, however the output tiff library and dll files appear to have been generated. I have not yet used these output files in any of my applications. I don't have a clean Visual Studio 2008 installation to try.
In my opinion I would prefer the option for setting the JPEG include and library paths to be in the default rather than the advanced view of CMake-Gui. Is this an option that other people are worried about?
Dr. Rhys Thomas
Computational Science and Engineering/Applied Computing in Biology, Medicine and Health
School of Computing
University of Leeds
0113 34 35489