CMAKE_FIND_LIBRARY_PREFIXES on older CMake versions

I ran into the following while trying to configure a project on appveyor, which has CMake 3.16.2 installed, and independently with CMake 3.18.5:

-- Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_FIND_LIBRARY_PREFIXES

For what’s worth, I downloaded the CMake 3.18.5 zip archive to produce this manually.

The CMakeLists.txt configures without this issue on CMake 3.23, which is what I usually use. If I set CMAKE_FIND_LIBRARY_PREFIXES manually for WIN32, FindPNG doesn’t find the library:

if (WIN32)
    list(APPEND CMAKE_FIND_LIBRARY_PREFIXES "" "lib")
    list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a")
endif ()

What’s the proper workaround/fix?

The backstory for this question: I’ve been building CMake support for the github open-simh project (simulators for historic computing systems, e.g., PDP-8, PDP-11, VAXen). The original simh maintainer absolutely insists that older versions of CMake and MSVC have to be supported. The closest I can get is using appveyor, which has older MSVC compilers in their image set.