PNGΒΆ

hunter_add_package(PNG)
find_package(PNG CONFIG REQUIRED)

add_executable(boo main.cpp)
target_link_libraries(boo PRIVATE PNG::png)

For compatibility with the FindPNG module, the ALIAS target PNG::PNG can be used too (requires CMake version >= 3.11!):

add_executable(baz main.cpp)
target_link_libraries(baz PRIVATE PNG::PNG)