[cmake-developers] FindZLIB module should find debug and release variants

Roger Leigh rleigh at codelibre.net
Sun Aug 23 06:21:39 EDT 2015


On 23/08/2015 10:07, Michael Scott wrote:
> Carrying on in the list of open issues to look at for contributing to
> CMake, I've had a look at issue "15280 - FindZLIB module should find
> debug and release variants". I've made some changes to the FindZLIB
> module which should make it so that debug and release variants are found
> as separate libraries, if they're both found then they're provided in
> ZLIB_LIBRARIES and ZLIB::ZLIB's imported location properties. Attached
> is the patch for FindZLIB.cmake.
>
> With this, I noticed that the Windows DLL's use different file names for
> the release and debug variants, but I couldn't tell if this is true on
> UNIX, it didn't seem to be the case. As the change to FinZLIB is based
> on the two variants having different names, I'm not sure these changes
> will have any effect on UNIX, is this expected or am I missing
> something/going about it the wrong way?

I don't think so.  The debug suffix is a Windows-ism which you don't see 
on UNIX.

One criticism of the patch: It's not using SelectLibraryConfigurations 
to choose between the release and debug variants.  Could it be updated 
to do that for consistency?  See FindPNG.cmake as an example.  This 
should make the patch quite a bit simpler.


Regards,
Roger


More information about the cmake-developers mailing list