randy408 / libspng

Simple, modern libpng alternative
https://libspng.org
BSD 2-Clause "Simplified" License
741 stars 75 forks source link

Feature request: ability to disable CMake install targets #266

Open jchv opened 8 months ago

jchv commented 8 months ago

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.)