Use imported targets for linking to libpng

This massively simplifies the process lol
This commit is contained in:
ISSOtm
2026-03-15 12:20:18 +01:00
committed by Rangi
parent 2d0ac7eeb0
commit d8722b6705
3 changed files with 5 additions and 23 deletions

View File

@@ -123,7 +123,8 @@ if(MSVC OR NOT PKG_CONFIG_FOUND)
# this is most evident on macOS but can occur on Linux too
find_package(PNG REQUIRED)
else()
pkg_check_modules(LIBPNG REQUIRED libpng)
pkg_check_modules(LIBPNG REQUIRED IMPORTED_TARGET libpng)
add_library(PNG::PNG ALIAS PkgConfig::LIBPNG)
endif()
include_directories("include")