[Zlib-devel] Testing CMakeLists from zlib 1.2.3.5

Philip Lowman philip at yhbt.com
Thu Jan 14 00:14:03 EST 2010


On Wed, Jan 13, 2010 at 7:11 AM, Philip Lowman <philip at yhbt.com> wrote:
> On Tue, Jan 12, 2010 at 11:28 PM, Cosmin Truta <ctruta at gmail.com> wrote:
>> 3). zlib's DLL name is zlib1.dll, the same was as libpng's DLL name is
>> libpng14.dll. See the DLL_FAQ.txt in the win32/ directory.
>
> Thanks, didn't realize this.  I will fix the output name of the DLL to
> be zlib1.dll in a future patch.  I believe this is done with the
> OUTPUT_NAME CMake target property.

Turns out the easiest way was to use the SUFFIX target property to add
the version number.  This works on MinGW & MSVC in the patch below.

>> 4). Is it necessary to hard-code the zlib version (zlib PROPERTIES
>> VERSION 1.2.3.4)? It's an extra maintenance issue, and one more thing
>> to fall out of sync. (As you see, it did already.)
>
> I will add support to read the version number from zlib.h dynamically.
>  I also never tested to see if the VERSION property in CMakeLists.txt
> is actually doing anything to the DLL so I'll do that as well.

I added regex parsing of zlib.h support for the full version number.

Turns out however, that the VERSION property was only doing stuff for
Linux shared libraries and Cygwin (and probably some other platforms
as well).  For MinGW & MSVC generated DLLs I had to add the
win32/zlib1.rc file to the build in order to get the version encoded.

Here's the full list of changes in the patch.

====

Patch against zlib-1.2.3.5
* Fixed DLL's generated with MinGW & MSVC to include the zlib1.rc file
so they have copyright & version info in details.
* Version of zlib is now parsed from zlib.h which fixes shared library
filenames on certain platforms like Linux so they will automatically
have the right version.  1.2.3.5 had a hardcoded 1.2.3.4 version in
the CMakeLists.txt.
* Modified Cygwin generated DLL to not have full version number in the filename
* Fixed MSVC generated DLL to have a "1" at the end: i.e. zlib1.dll
* Modified MSVC debug library so the "d" appended at the end is lowercase


P.S.
Noticed copyright years in zlib1.rc (and perhaps elsewhere) need modifications.

-- 
Philip Lowman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1235cmakefixes.diff
Type: application/octet-stream
Size: 3059 bytes
Desc: not available
URL: <http://madler.net/pipermail/zlib-devel_madler.net/attachments/20100114/3c3981aa/attachment.obj>


More information about the Zlib-devel mailing list