pnggroup / libpng

LIBPNG: Portable Network Graphics support, official libpng repository
http://libpng.sf.net
Other
1.25k stars 611 forks source link

CMake: Properly declare target include directories for generated includes #554

Open Green-Sky opened 4 months ago

Green-Sky commented 4 months ago

Previously the non targeted include_directories() was used, which had issue when using the png_static target in a submodule.

I came across this issue why trying to link sdl3_image with static vendored libs, which links against png_static. For some reason png_shared exported the binary include path just fine, but png_static not, resulting in pnglibconf.h not being found. So I cleaned up the cmake a little and explicitly added the include dirs to the targets directly.