You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When vendoring libspng, it would be very useful to be able to disable the CMake install targets. There are some situations that can't really be worked around otherwise; an example is if you vendor zlib and make libspng link to that. If you do this, then the install target will cause CMake to fail with an error:
CMake Error: install(EXPORT "SPNGTargets" ...) includes target "spng_static" which requires target "zlib" that is not in any export set.
I've tried quite a few workarounds, but so far no dice. It really seems like you just need a way to disable install targets. The convention that I've seen the most is honoring SKIP_INSTALL_* options, for example, this commit in Freetype.
(P.S.: I am happy to contribute this myself, too, if it is something that would be accepted. Seems trivial enough.)
The text was updated successfully, but these errors were encountered:
jchv
added a commit
to jchw-forks/libspng
that referenced
this issue
Mar 9, 2024
This patch makes the following improvements to the CMake configuration:
- If the target ZLIB::ZLIB already exists, find_package for zlib is not
called: this is advantageous if the project that is vendoring libspng
is also vendoring zlib, or has an alternate zlib implementation (like
zlib-ng.) Otherwise, ugly hacks are needed to make the find_package a
no-op (e.g.: introducing a FindZLIB.cmake module somewhere earlier in
the search path that does this check and then calls the root module.)
- It will now honor the `SKIP_INSTALL_ALL`, `SKIP_INSTALL_HEADERS`, and
`SKIP_INSTALL_LIBRARIES` variables when setting up `install` targets.
This is useful because zlib also honors this setting, and there's not
much sense in installing libspng if it depends on vendored zlib which
is not going to have install targets. (It causes an error, too.)
This should be fairly safe: when configuring standalone, this shouldn't
change any of the existing behavior. For vendoring with `FetchContent`,
I reckon this still shouldn't break any of the existing cases. This can
help on Windows for a project that aims to compile out-of-the-box using
Visual Studio without needing tooling like vcpkg, as zlib isn't present
by default in this environment.
Fixesrandy408#266.
jchv
linked a pull request
Mar 9, 2024
that will
close
this issue
When vendoring libspng, it would be very useful to be able to disable the CMake install targets. There are some situations that can't really be worked around otherwise; an example is if you vendor zlib and make libspng link to that. If you do this, then the install target will cause CMake to fail with an error:
I've tried quite a few workarounds, but so far no dice. It really seems like you just need a way to disable install targets. The convention that I've seen the most is honoring
SKIP_INSTALL_*
options, for example, this commit in Freetype.(P.S.: I am happy to contribute this myself, too, if it is something that would be accepted. Seems trivial enough.)
The text was updated successfully, but these errors were encountered: