mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
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:
committed by
Cosmin Truta
parent
53a7f4e320
commit
0e204b7364
15
scripts/cmake/PNGConfig.cmake
Normal file
15
scripts/cmake/PNGConfig.cmake
Normal 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()
|
||||
@@ -20,6 +20,7 @@ File List
|
||||
CMakeLists.txt ==> The main CMake lists file
|
||||
scripts/cmake/AUTHORS.md ==> The Authors file
|
||||
scripts/cmake/README.md ==> This file
|
||||
scripts/cmake/PNGConfig.cmake ==> Config file for FindPNG
|
||||
scripts/cmake/genchk.cmake.in ==> Template for genchk.cmake
|
||||
scripts/cmake/genout.cmake.in ==> Template for genout.cmake
|
||||
scripts/cmake/gensrc.cmake.in ==> Template for gensrc.cmake
|
||||
|
||||
Reference in New Issue
Block a user