Skip to content

FindPNG: Add static libpng names for MSVC

Steve Robinson requested to merge ssrobins/cmake:master into master

In the official libpng CMakeLists.txt file, the library file name is libpng16_staticd for debug and otherwise libpng16_static for static libraries on MSVC.

The FindPNG.cmake file included in CMake does not contain those library name variations so it won't find the static libraries for MSVC, unless they are renamed. This merge request would fix that.

There is already a similar change in FindZLIB.cmake, which contains the zlibstatic variation.

To verify the change, I copied the modified FindPNG.cmake file into my existing CMake 3.15.0-rc4 install on Windows and ran find_package(PNG). The optimized and debug libpng static libs are now found.

Topic-rename: FindPNG-msvc-static

Edited by Brad King

Merge request reports