Skip to content

FindPNG.cmake: find library files with specific versions first.

Michael Hofmann requested to merge kmhofmann/cmake:patch-1 into master

Find library files with specific version numbers in the name (e.g. libpng16.a or libpng17.so) first, and only look for the more generic name (e.g. libpng.so) afterwards.

Use case: vcpkg (https://github.com/Microsoft/vcpkg) builds a file called 'libpng16.a' on Linux (similar on respective platforms). On many distributions, incl. Ubuntu, the library provided by system package managers is called 'libpng.so'. This leads to a situation where, when using vcpkg, it finds the vcpkg-installed headers but the system provided library. Changing the search order fixes this.

Merge request reports