Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
cmake: add support for transitive ZLIB target #3123
In my use case, I want to link ZLIB statically. Currently the default implementation of FindZlib favours
The transitive target gives more control to the library user to control whether to link statically or shared without relying on clumsy hacks.
Also in terms of future proofing if usage requirements of ZLIB for some reason change, they will be transitioned with the target to the client app rather than being decomposed to _LIBS and _INCLUDE_DIRS variables which might strip some of those requirements.
The commit above implements the requested changes. I also noticed the HAVE_ZLIB variable wasn't used anywhere so I changed it to USE_ZLIB to be consistent with the USE_OPENSSL.
Also removed the unnecessary quotes from the @variables so the results after configure_file is: