Change CMake generated pkgconfig to match meson. - #286
Open
BillyONeal wants to merge 3 commits into
Open
Conversation
In vcpkg we want to make sure that CMake and pkg-config customers get an experience that works, including transitively. In reviewing microsoft/vcpkg#52891 we discovered that the transitive libjpeg-turbo -> libspng .pc link is broken. In trying to fix that I ran into a transitive problem here. https://github.com/randy408/libspng/blob/adc94393dbeddf9e027d1b2dfff7c1bab975224e/CMakeLists.txt#L103-L107 installs `libspng.pc` and `libspng_static.pc`, but https://github.com/randy408/libspng/blob/adc94393dbeddf9e027d1b2dfff7c1bab975224e/meson.build#L82-L87 installs `spng.pc`. This seems to be the one `libjpeg-turbo` is looking to be compatible with. https://packages.debian.org/sid/amd64/libspng-dev/filelist Looks like Debian is using the meson build, given that they install `/usr/lib/x86_64-linux-gnu/pkgconfig/spng.pc`. Also, meson detects whether the .pc should link with `libm` by probing for existence of the library: https://github.com/randy408/libspng/blob/adc94393dbeddf9e027d1b2dfff7c1bab975224e/meson.build#L42 while CMake just assumes "Windows gets no libm, everyone else does". This change changes everything to match meson. The problems discussed here and some of the suggested outcomes are from GPT 5.6 Sol.
BillyONeal
added a commit
to BillyONeal/vcpkg
that referenced
this pull request
Aug 21, 2026
Related: microsoft#52891 Related: randy408/libspng#286 This changes libspng to install pkg-config on all platforms matching that installed by Debian. Also fix the declared licenses to match the SPDX expression. Their README says: >## License > >Code is licensed under the BSD 2-clause "Simplified" License. > >The project contains optimizations and test images from libpng, these are licensed under the [PNG Reference Library License version 2](http://www.libpng.org/pub/png/src/libpng-LICENSE.txt). but they don't have a copy of the license. The content under that license is incorporated into the .c so we have to install the whole thing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In vcpkg we want to make sure that CMake and pkg-config customers get an experience that works, including transitively. In reviewing microsoft/vcpkg#52891 we discovered that the transitive libjpeg-turbo -> libspng .pc link is broken. In trying to fix that I ran into a transitive problem here.
libspng/CMakeLists.txt
Lines 103 to 107 in adc9439
installs
libspng.pcandlibspng_static.pc, butlibspng/meson.build
Lines 82 to 87 in adc9439
installs
spng.pc. This seems to be the onelibjpeg-turbois looking to be compatible with.https://packages.debian.org/sid/amd64/libspng-dev/filelist Looks like Debian is using the meson build, given that they install
/usr/lib/x86_64-linux-gnu/pkgconfig/spng.pc.Also, meson detects whether the .pc should link with
libmby probing for existence of the library:libspng/meson.build
Line 42 in adc9439
while CMake just assumes "Windows gets no libm, everyone else does". This change changes everything to match meson.
The problems discussed here and some of the suggested outcomes are from GPT 5.6 Sol.