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

Rolf Eike Beer eike at sf-mail.de
Sun Aug 23 06:22:08 EDT 2015


Michael Scott wrote:
> Hi,
> 
> 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?

On Unix systems those variants usually do not exists, as there are no 
different standard libraries (and therefore e.g. allocators) used for release 
and debug mode.

You should use SelectLibraryConfigurations.cmake instead of building the list 
of libraries yourself. Look at FindPNG.cmake, which uses it.

I wonder if we should add a function or macro to SLC which does the target 
fiddling which is done at the bottom of the patch.

Eike
-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150823/1ed418de/attachment.sig>


More information about the cmake-developers mailing list