-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Provide ZLIB::ZLIB as a CMake alias when shared libraries are disabled #1086
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
Point 1: Why do you checkif the target exists, if you could check for the option if the target should be created? Point 2: FindZLIB tries to provide something, but the point in the named targets is to know what you link against. If you you want a static linking, there's a target. Imagine you expect dynamic linking and want to install the dll in your script, but there is none, you would have to add additional checks. Yes, with your changes in the config you mimic the old behaviour, but if someone includes the sources Idmeand them to check if there are changes. Such situations happen with apis all the time, so it's not asked too much to check if all the targets are still correct (and if you link against ZLIB:::ZLIB and don't set any options you'll have no problems in this case), and instead of checking for existing dll's I consider it better to check for the version and just use the right targets in you build instead of hoping to get sommething. |
from: https://cmake.org/cmake/help/latest/module/FindZLIB.html So having |
You mean when you So in all 3 cases you can set ZLIB_BUILD_SHARED to OFF before doing this and alias this yourself. also if consumer require to know if it is a static or a shared lib (which also can be see as an integration implementation details) you could still use Because FindZLIB line 254 sets it to UNKNOWN and you'll never know? But if you mention genex as an point, what about |
|
@madler: Have you seen this PR? |
|
I usually don't comment such things, but there are some problems with this text:
|
This matches the behaviour of
FindZLIBfrom standard CMake installations.