1
0
mirror of https://github.com/glennrp/libpng.git synced 2025-08-07 13:22:57 +03:00
Files
libpng/scripts/cmake/PNGConfig.cmake
Cosmin Truta a7a8faeefa [libpng16] style: Add a cmake-format config file and satisfy cmake-lint
Introduce CMake file linting, based on the cmakelang project by
Josh Bialkowski (@cheshirekow).

Fix various style issues in the CMake files:
 * Add the missing copyright header to PNGConfig.cmake.
 * Resolve a "missing docstring" warning raised by cmake-lint.
 * Rewrite all docstrings in the style of CMake's own documentation.
 * Fix whitespace inconsistencies.

References:
 * https://pypi.org/project/cmakelang
 * https://github.com/cheshirekow/cmake_format

This is a cherry-pick of commit c317fe3111
from branch 'libpng18'.
2024-10-12 19:37:50 +03:00

29 lines
833 B
CMake

# PNGConfig.cmake
# CMake config file compatible with the FindPNG module.
# Copyright (c) 2024 Cosmin Truta
# Written by Benjamin Buch, 2024
#
# Use, modification and distribution are subject to
# the same licensing terms and conditions as libpng.
# Please see the copyright notice in png.h or visit
# http://libpng.org/pub/png/src/libpng-LICENSE.txt
#
# SPDX-License-Identifier: libpng-2.0
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()