build: Add a CMake config file compatible with the FindPNG module

Co-authored-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
This commit is contained in:
Benjamin Buch
2024-03-01 13:14:17 +01:00
committed by Cosmin Truta
parent 53a7f4e320
commit 0e204b7364
3 changed files with 40 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
include(CMakeFindDependencyMacro)
find_dependency(ZLIB REQUIRED)
include("${CMAKE_CURRENT_LIST_DIR}/PNGTargets.cmake")
if(NOT TARGET PNG::PNG)
if(TARGET PNG::png_shared)
add_library(PNG::PNG INTERFACE IMPORTED)
target_link_libraries(PNG::PNG INTERFACE PNG::png_shared)
elseif(TARGET PNG::png_static)
add_library(PNG::PNG INTERFACE IMPORTED)
target_link_libraries(PNG::PNG INTERFACE PNG::png_static)
endif()
endif()