mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
chore: Add a TODO note in .cmake-format.yaml; reformat CMakeLists.txt
Apply some (but not all) of the suggestions made by the cmake-format program. Meanwhile, the cmake-lint program is (still) happy.
This commit is contained in:
parent
23bdc7a6c4
commit
3e67531078
@ -39,8 +39,8 @@ disabled_codes: [
|
|||||||
# re-enable the "invalid variable name XXX" messages.
|
# re-enable the "invalid variable name XXX" messages.
|
||||||
"C0103",
|
"C0103",
|
||||||
|
|
||||||
# A custom command with one output doesn't really need a comment because
|
# TODO:
|
||||||
# the default "generating XXX" is a good message already.
|
# Add brief COMMENT arguments to the `add_custom_target` commands.
|
||||||
"C0113",
|
"C0113",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -82,10 +82,10 @@ keyword_pattern: "[A-Z][0-9A-Z_]+"
|
|||||||
# before considering the loop a parser
|
# before considering the loop a parser
|
||||||
max_conditionals_custom_parser: 2
|
max_conditionals_custom_parser: 2
|
||||||
|
|
||||||
# Require at least this many newlines between statements
|
# Require at least this many newlines between statements;
|
||||||
|
# require no more than this many newlines between statements;
|
||||||
|
# etc.
|
||||||
min_statement_spacing: 1
|
min_statement_spacing: 1
|
||||||
|
|
||||||
# Require no more than this many newlines between statements
|
|
||||||
max_statement_spacing: 2
|
max_statement_spacing: 2
|
||||||
max_returns: 6
|
max_returns: 6
|
||||||
max_branches: 12
|
max_branches: 12
|
||||||
|
246
CMakeLists.txt
246
CMakeLists.txt
@ -34,14 +34,16 @@ include(GNUInstallDirs)
|
|||||||
|
|
||||||
# Allow the users to specify an application-specific API prefix for libpng
|
# Allow the users to specify an application-specific API prefix for libpng
|
||||||
# vendoring purposes. A standard libpng build should have no such prefix.
|
# vendoring purposes. A standard libpng build should have no such prefix.
|
||||||
set(PNG_PREFIX ""
|
set(PNG_PREFIX
|
||||||
|
""
|
||||||
CACHE STRING "Prefix to prepend to the API function names")
|
CACHE STRING "Prefix to prepend to the API function names")
|
||||||
|
|
||||||
# Allow the users to override the postfix appended to debug library file names.
|
# Allow the users to override the postfix appended to debug library file names.
|
||||||
# Previously, we used to set CMAKE_DEBUG_POSTFIX globally. That variable should
|
# Previously, we used to set CMAKE_DEBUG_POSTFIX globally. That variable should
|
||||||
# not be cached, however, because doing so would affect all projects processed
|
# not be cached, however, because doing so would affect all projects processed
|
||||||
# after libpng, in unexpected and undesirable ways.
|
# after libpng, in unexpected and undesirable ways.
|
||||||
set(PNG_DEBUG_POSTFIX "d"
|
set(PNG_DEBUG_POSTFIX
|
||||||
|
"d"
|
||||||
CACHE STRING "Postfix to append to library file names under the Debug configuration")
|
CACHE STRING "Postfix to append to library file names under the Debug configuration")
|
||||||
|
|
||||||
# Allow the users to import their own extra configuration settings.
|
# Allow the users to import their own extra configuration settings.
|
||||||
@ -50,18 +52,20 @@ set(PNG_DEBUG_POSTFIX "d"
|
|||||||
# header file form (such as "scripts/pnglibconf.h.prebuilt"), but not both.
|
# header file form (such as "scripts/pnglibconf.h.prebuilt"), but not both.
|
||||||
# For platforms such as Android or iOS, or in certain cross-platform build
|
# For platforms such as Android or iOS, or in certain cross-platform build
|
||||||
# scenarios, having a valid PNG_LIBCONF_HEADER is mandatory.
|
# scenarios, having a valid PNG_LIBCONF_HEADER is mandatory.
|
||||||
set(DFA_XTRA ""
|
set(DFA_XTRA
|
||||||
|
""
|
||||||
CACHE FILEPATH "DFA file containing customized build configuration settings for libpng")
|
CACHE FILEPATH "DFA file containing customized build configuration settings for libpng")
|
||||||
set(PNG_LIBCONF_HEADER ""
|
set(PNG_LIBCONF_HEADER
|
||||||
|
""
|
||||||
CACHE FILEPATH "C header file containing customized build configuration settings for libpng")
|
CACHE FILEPATH "C header file containing customized build configuration settings for libpng")
|
||||||
set(PNG_LIBCONF_HEADER_PREBUILT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt")
|
set(PNG_LIBCONF_HEADER_PREBUILT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt")
|
||||||
if(ANDROID OR IOS)
|
if(ANDROID OR IOS)
|
||||||
set(PNG_LIBCONF_HEADER "${PNG_LIBCONF_HEADER_PREBUILT}")
|
set(PNG_LIBCONF_HEADER "${PNG_LIBCONF_HEADER_PREBUILT}")
|
||||||
endif()
|
endif()
|
||||||
if((NOT DFA_XTRA STREQUAL "") AND (NOT PNG_LIBCONF_HEADER STREQUAL ""))
|
if((NOT DFA_XTRA STREQUAL "") AND (NOT PNG_LIBCONF_HEADER STREQUAL ""))
|
||||||
message(SEND_ERROR
|
message(SEND_ERROR "The options DFA_XTRA=\"${DFA_XTRA}\" "
|
||||||
"The options DFA_XTRA=\"${DFA_XTRA}\" and PNG_LIBCONF_HEADER=\"${PNG_LIBCONF_HEADER}\" "
|
"and PNG_LIBCONF_HEADER=\"${PNG_LIBCONF_HEADER}\" "
|
||||||
"are mutually exclusive")
|
"are mutually exclusive")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Allow the users to switch on/off various library build types.
|
# Allow the users to switch on/off various library build types.
|
||||||
@ -95,8 +99,8 @@ option(PNG_EXECUTABLES "[Deprecated; please use PNG_TOOLS]" ON)
|
|||||||
if(NOT PNG_EXECUTABLES)
|
if(NOT PNG_EXECUTABLES)
|
||||||
message(DEPRECATION "The option PNG_EXECUTABLES has been deprecated in favour of PNG_TOOLS")
|
message(DEPRECATION "The option PNG_EXECUTABLES has been deprecated in favour of PNG_TOOLS")
|
||||||
if(PNG_TOOLS)
|
if(PNG_TOOLS)
|
||||||
message(AUTHOR_WARNING
|
message(AUTHOR_WARNING "Setting PNG_TOOLS to ${PNG_EXECUTABLES}, "
|
||||||
"Setting PNG_TOOLS to ${PNG_EXECUTABLES}, to stay compatible with PNG_EXECUTABLES")
|
"to stay compatible with PNG_EXECUTABLES")
|
||||||
set(PNG_TOOLS "${PNG_EXECUTABLES}")
|
set(PNG_TOOLS "${PNG_EXECUTABLES}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@ -125,13 +129,11 @@ message(STATUS "Building for target architecture: ${PNG_TARGET_ARCHITECTURE}")
|
|||||||
option(PNG_BUILD_ZLIB "[Deprecated; please use ZLIB_ROOT]" OFF)
|
option(PNG_BUILD_ZLIB "[Deprecated; please use ZLIB_ROOT]" OFF)
|
||||||
if(PNG_BUILD_ZLIB)
|
if(PNG_BUILD_ZLIB)
|
||||||
if("x${ZLIB_ROOT}" STREQUAL "x")
|
if("x${ZLIB_ROOT}" STREQUAL "x")
|
||||||
message(SEND_ERROR
|
message(SEND_ERROR "The option PNG_BUILD_ZLIB=${PNG_BUILD_ZLIB} is no longer supported; "
|
||||||
"The option PNG_BUILD_ZLIB=${PNG_BUILD_ZLIB} is no longer supported; "
|
"please use ZLIB_ROOT instead")
|
||||||
"please use ZLIB_ROOT instead")
|
|
||||||
else()
|
else()
|
||||||
message(SEND_ERROR
|
message(SEND_ERROR "The option PNG_BUILD_ZLIB=${PNG_BUILD_ZLIB} is no longer supported; "
|
||||||
"The option PNG_BUILD_ZLIB=${PNG_BUILD_ZLIB} is no longer supported; "
|
"using ZLIB_ROOT=\"${ZLIB_ROOT}\"")
|
||||||
"using ZLIB_ROOT=\"${ZLIB_ROOT}\"")
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -157,15 +159,17 @@ if(PNG_HARDWARE_OPTIMIZATIONS)
|
|||||||
if(PNG_TARGET_ARCHITECTURE MATCHES "^(arm|aarch)")
|
if(PNG_TARGET_ARCHITECTURE MATCHES "^(arm|aarch)")
|
||||||
if(PNG_TARGET_ARCHITECTURE MATCHES "^(arm64|aarch64)")
|
if(PNG_TARGET_ARCHITECTURE MATCHES "^(arm64|aarch64)")
|
||||||
set(PNG_ARM_NEON_POSSIBLE_VALUES on off)
|
set(PNG_ARM_NEON_POSSIBLE_VALUES on off)
|
||||||
set(PNG_ARM_NEON "on"
|
set(PNG_ARM_NEON
|
||||||
|
"on"
|
||||||
CACHE STRING "Enable ARM NEON optimizations: on|off; on is default")
|
CACHE STRING "Enable ARM NEON optimizations: on|off; on is default")
|
||||||
else()
|
else()
|
||||||
set(PNG_ARM_NEON_POSSIBLE_VALUES check on off)
|
set(PNG_ARM_NEON_POSSIBLE_VALUES check on off)
|
||||||
set(PNG_ARM_NEON "off"
|
set(PNG_ARM_NEON
|
||||||
|
"off"
|
||||||
CACHE STRING "Enable ARM NEON optimizations: check|on|off; off is default")
|
CACHE STRING "Enable ARM NEON optimizations: check|on|off; off is default")
|
||||||
endif()
|
endif()
|
||||||
set_property(CACHE PNG_ARM_NEON
|
set_property(CACHE PNG_ARM_NEON
|
||||||
PROPERTY STRINGS ${PNG_ARM_NEON_POSSIBLE_VALUES})
|
PROPERTY STRINGS ${PNG_ARM_NEON_POSSIBLE_VALUES})
|
||||||
list(FIND PNG_ARM_NEON_POSSIBLE_VALUES ${PNG_ARM_NEON} index)
|
list(FIND PNG_ARM_NEON_POSSIBLE_VALUES ${PNG_ARM_NEON} index)
|
||||||
if(index EQUAL -1)
|
if(index EQUAL -1)
|
||||||
message(FATAL_ERROR "PNG_ARM_NEON must be one of [${PNG_ARM_NEON_POSSIBLE_VALUES}]")
|
message(FATAL_ERROR "PNG_ARM_NEON must be one of [${PNG_ARM_NEON_POSSIBLE_VALUES}]")
|
||||||
@ -187,10 +191,11 @@ if(PNG_HARDWARE_OPTIMIZATIONS)
|
|||||||
# Set definitions and sources for PowerPC.
|
# Set definitions and sources for PowerPC.
|
||||||
if(PNG_TARGET_ARCHITECTURE MATCHES "^(powerpc|ppc64)")
|
if(PNG_TARGET_ARCHITECTURE MATCHES "^(powerpc|ppc64)")
|
||||||
set(PNG_POWERPC_VSX_POSSIBLE_VALUES on off)
|
set(PNG_POWERPC_VSX_POSSIBLE_VALUES on off)
|
||||||
set(PNG_POWERPC_VSX "on"
|
set(PNG_POWERPC_VSX
|
||||||
|
"on"
|
||||||
CACHE STRING "Enable POWERPC VSX optimizations: on|off; on is default")
|
CACHE STRING "Enable POWERPC VSX optimizations: on|off; on is default")
|
||||||
set_property(CACHE PNG_POWERPC_VSX
|
set_property(CACHE PNG_POWERPC_VSX
|
||||||
PROPERTY STRINGS ${PNG_POWERPC_VSX_POSSIBLE_VALUES})
|
PROPERTY STRINGS ${PNG_POWERPC_VSX_POSSIBLE_VALUES})
|
||||||
list(FIND PNG_POWERPC_VSX_POSSIBLE_VALUES ${PNG_POWERPC_VSX} index)
|
list(FIND PNG_POWERPC_VSX_POSSIBLE_VALUES ${PNG_POWERPC_VSX} index)
|
||||||
if(index EQUAL -1)
|
if(index EQUAL -1)
|
||||||
message(FATAL_ERROR "PNG_POWERPC_VSX must be one of [${PNG_POWERPC_VSX_POSSIBLE_VALUES}]")
|
message(FATAL_ERROR "PNG_POWERPC_VSX must be one of [${PNG_POWERPC_VSX_POSSIBLE_VALUES}]")
|
||||||
@ -209,10 +214,11 @@ if(PNG_HARDWARE_OPTIMIZATIONS)
|
|||||||
# Set definitions and sources for Intel.
|
# Set definitions and sources for Intel.
|
||||||
if(PNG_TARGET_ARCHITECTURE MATCHES "^(i[3-6]86|x86|amd64)")
|
if(PNG_TARGET_ARCHITECTURE MATCHES "^(i[3-6]86|x86|amd64)")
|
||||||
set(PNG_INTEL_SSE_POSSIBLE_VALUES on off)
|
set(PNG_INTEL_SSE_POSSIBLE_VALUES on off)
|
||||||
set(PNG_INTEL_SSE "on"
|
set(PNG_INTEL_SSE
|
||||||
|
"on"
|
||||||
CACHE STRING "Enable INTEL_SSE optimizations: on|off; on is default")
|
CACHE STRING "Enable INTEL_SSE optimizations: on|off; on is default")
|
||||||
set_property(CACHE PNG_INTEL_SSE
|
set_property(CACHE PNG_INTEL_SSE
|
||||||
PROPERTY STRINGS ${PNG_INTEL_SSE_POSSIBLE_VALUES})
|
PROPERTY STRINGS ${PNG_INTEL_SSE_POSSIBLE_VALUES})
|
||||||
list(FIND PNG_INTEL_SSE_POSSIBLE_VALUES ${PNG_INTEL_SSE} index)
|
list(FIND PNG_INTEL_SSE_POSSIBLE_VALUES ${PNG_INTEL_SSE} index)
|
||||||
if(index EQUAL -1)
|
if(index EQUAL -1)
|
||||||
message(FATAL_ERROR "PNG_INTEL_SSE must be one of [${PNG_INTEL_SSE_POSSIBLE_VALUES}]")
|
message(FATAL_ERROR "PNG_INTEL_SSE must be one of [${PNG_INTEL_SSE_POSSIBLE_VALUES}]")
|
||||||
@ -231,20 +237,22 @@ if(PNG_HARDWARE_OPTIMIZATIONS)
|
|||||||
# Set definitions and sources for MIPS.
|
# Set definitions and sources for MIPS.
|
||||||
if(PNG_TARGET_ARCHITECTURE MATCHES "^(mipsel|mips64el)")
|
if(PNG_TARGET_ARCHITECTURE MATCHES "^(mipsel|mips64el)")
|
||||||
set(PNG_MIPS_MSA_POSSIBLE_VALUES on off)
|
set(PNG_MIPS_MSA_POSSIBLE_VALUES on off)
|
||||||
set(PNG_MIPS_MSA "on"
|
set(PNG_MIPS_MSA
|
||||||
|
"on"
|
||||||
CACHE STRING "Enable MIPS_MSA optimizations: on|off; on is default")
|
CACHE STRING "Enable MIPS_MSA optimizations: on|off; on is default")
|
||||||
set_property(CACHE PNG_MIPS_MSA
|
set_property(CACHE PNG_MIPS_MSA
|
||||||
PROPERTY STRINGS ${PNG_MIPS_MSA_POSSIBLE_VALUES})
|
PROPERTY STRINGS ${PNG_MIPS_MSA_POSSIBLE_VALUES})
|
||||||
list(FIND PNG_MIPS_MSA_POSSIBLE_VALUES ${PNG_MIPS_MSA} index_msa)
|
list(FIND PNG_MIPS_MSA_POSSIBLE_VALUES ${PNG_MIPS_MSA} index_msa)
|
||||||
if(index_msa EQUAL -1)
|
if(index_msa EQUAL -1)
|
||||||
message(FATAL_ERROR "PNG_MIPS_MSA must be one of [${PNG_MIPS_MSA_POSSIBLE_VALUES}]")
|
message(FATAL_ERROR "PNG_MIPS_MSA must be one of [${PNG_MIPS_MSA_POSSIBLE_VALUES}]")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(PNG_MIPS_MMI_POSSIBLE_VALUES on off)
|
set(PNG_MIPS_MMI_POSSIBLE_VALUES on off)
|
||||||
set(PNG_MIPS_MMI "on"
|
set(PNG_MIPS_MMI
|
||||||
|
"on"
|
||||||
CACHE STRING "Enable MIPS_MMI optimizations: on|off; on is default")
|
CACHE STRING "Enable MIPS_MMI optimizations: on|off; on is default")
|
||||||
set_property(CACHE PNG_MIPS_MMI
|
set_property(CACHE PNG_MIPS_MMI
|
||||||
PROPERTY STRINGS ${PNG_MIPS_MMI_POSSIBLE_VALUES})
|
PROPERTY STRINGS ${PNG_MIPS_MMI_POSSIBLE_VALUES})
|
||||||
list(FIND PNG_MIPS_MMI_POSSIBLE_VALUES ${PNG_MIPS_MMI} index_mmi)
|
list(FIND PNG_MIPS_MMI_POSSIBLE_VALUES ${PNG_MIPS_MMI} index_mmi)
|
||||||
if(index_mmi EQUAL -1)
|
if(index_mmi EQUAL -1)
|
||||||
message(FATAL_ERROR "PNG_MIPS_MMI must be one of [${PNG_MIPS_MMI_POSSIBLE_VALUES}]")
|
message(FATAL_ERROR "PNG_MIPS_MMI must be one of [${PNG_MIPS_MMI_POSSIBLE_VALUES}]")
|
||||||
@ -279,25 +287,25 @@ if(PNG_HARDWARE_OPTIMIZATIONS)
|
|||||||
if(PNG_TARGET_ARCHITECTURE MATCHES "^(loongarch)")
|
if(PNG_TARGET_ARCHITECTURE MATCHES "^(loongarch)")
|
||||||
include(CheckCCompilerFlag)
|
include(CheckCCompilerFlag)
|
||||||
set(PNG_LOONGARCH_LSX_POSSIBLE_VALUES on off)
|
set(PNG_LOONGARCH_LSX_POSSIBLE_VALUES on off)
|
||||||
set(PNG_LOONGARCH_LSX "on"
|
set(PNG_LOONGARCH_LSX
|
||||||
|
"on"
|
||||||
CACHE STRING "Enable LOONGARCH_LSX optimizations: on|off; on is default")
|
CACHE STRING "Enable LOONGARCH_LSX optimizations: on|off; on is default")
|
||||||
set_property(CACHE PNG_LOONGARCH_LSX
|
set_property(CACHE PNG_LOONGARCH_LSX
|
||||||
PROPERTY STRINGS ${PNG_LOONGARCH_LSX_POSSIBLE_VALUES})
|
PROPERTY STRINGS ${PNG_LOONGARCH_LSX_POSSIBLE_VALUES})
|
||||||
list(FIND PNG_LOONGARCH_LSX_POSSIBLE_VALUES ${PNG_LOONGARCH_LSX} index)
|
list(FIND PNG_LOONGARCH_LSX_POSSIBLE_VALUES ${PNG_LOONGARCH_LSX} index)
|
||||||
if(index EQUAL -1)
|
if(index EQUAL -1)
|
||||||
message(FATAL_ERROR "PNG_LOONGARCH_LSX must be one of [${PNG_LOONGARCH_LSX_POSSIBLE_VALUES}]")
|
message(FATAL_ERROR "PNG_LOONGARCH_LSX must be one of [${PNG_LOONGARCH_LSX_POSSIBLE_VALUES}]")
|
||||||
elseif(NOT PNG_LOONGARCH_LSX STREQUAL "off")
|
elseif(NOT PNG_LOONGARCH_LSX STREQUAL "off")
|
||||||
CHECK_C_COMPILER_FLAG("-mlsx" COMPILER_SUPPORTS_LSX)
|
check_c_compiler_flag("-mlsx" COMPILER_SUPPORTS_LSX)
|
||||||
if(COMPILER_SUPPORTS_LSX)
|
if(COMPILER_SUPPORTS_LSX)
|
||||||
set(libpng_loongarch_sources
|
set(libpng_loongarch_sources
|
||||||
loongarch/loongarch_lsx_init.c
|
loongarch/loongarch_lsx_init.c
|
||||||
loongarch/filter_lsx_intrinsics.c)
|
loongarch/filter_lsx_intrinsics.c)
|
||||||
set_source_files_properties(${libpng_loongarch_sources}
|
set_source_files_properties(${libpng_loongarch_sources}
|
||||||
PROPERTIES
|
PROPERTIES COMPILE_FLAGS "-mlsx")
|
||||||
COMPILE_FLAGS "-mlsx")
|
|
||||||
add_definitions(-DPNG_LOONGARCH_LSX_OPT=1)
|
add_definitions(-DPNG_LOONGARCH_LSX_OPT=1)
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Compiler does not support -mlsx option")
|
message(FATAL_ERROR "This compiler does not support the -mlsx option")
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
add_definitions(-DPNG_LOONGARCH_LSX_OPT=0)
|
add_definitions(-DPNG_LOONGARCH_LSX_OPT=0)
|
||||||
@ -346,7 +354,8 @@ VERS_2 { global: sym2; main; } VERS_1;
|
|||||||
# Solaris, because of an incompatibility with the Solaris link editor.
|
# Solaris, because of an incompatibility with the Solaris link editor.
|
||||||
list(APPEND CMAKE_REQUIRED_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
|
list(APPEND CMAKE_REQUIRED_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
|
||||||
endif()
|
endif()
|
||||||
list(APPEND CMAKE_REQUIRED_FLAGS "-Wl,--version-script='${CMAKE_CURRENT_BINARY_DIR}/conftest.map'")
|
list(APPEND CMAKE_REQUIRED_FLAGS
|
||||||
|
"-Wl,--version-script='${CMAKE_CURRENT_BINARY_DIR}/conftest.map'")
|
||||||
check_c_source_compiles("
|
check_c_source_compiles("
|
||||||
void sym1(void) {}
|
void sym1(void) {}
|
||||||
void sym2(void) {}
|
void sym2(void) {}
|
||||||
@ -399,8 +408,8 @@ elseif(NOT AWK)
|
|||||||
# Configure libpng with pnglibconf.h.prebuilt.
|
# Configure libpng with pnglibconf.h.prebuilt.
|
||||||
png_check_libconf(HEADER "${PNG_LIBCONF_HEADER_PREBUILT}")
|
png_check_libconf(HEADER "${PNG_LIBCONF_HEADER_PREBUILT}")
|
||||||
configure_file("${PNG_LIBCONF_HEADER_PREBUILT}"
|
configure_file("${PNG_LIBCONF_HEADER_PREBUILT}"
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h
|
${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h
|
||||||
@ONLY)
|
@ONLY)
|
||||||
add_custom_target(png_genfiles)
|
add_custom_target(png_genfiles)
|
||||||
else()
|
else()
|
||||||
png_check_libconf(DFA_XTRA "${DFA_XTRA}")
|
png_check_libconf(DFA_XTRA "${DFA_XTRA}")
|
||||||
@ -457,14 +466,16 @@ else()
|
|||||||
|
|
||||||
# Generate pnglibconf.h
|
# Generate pnglibconf.h
|
||||||
generate_source(OUTPUT "pnglibconf.h"
|
generate_source(OUTPUT "pnglibconf.h"
|
||||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out" pnglibconf_out
|
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out"
|
||||||
|
pnglibconf_out
|
||||||
${PNGLIBCONF_H_EXTRA_DEPENDS})
|
${PNGLIBCONF_H_EXTRA_DEPENDS})
|
||||||
add_custom_target(pnglibconf_h
|
add_custom_target(pnglibconf_h
|
||||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h")
|
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h")
|
||||||
|
|
||||||
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/intprefix.c"
|
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/intprefix.c"
|
||||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out"
|
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out"
|
||||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h" pnglibconf_h)
|
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
|
||||||
|
pnglibconf_h)
|
||||||
add_custom_target(png_scripts_intprefix_out
|
add_custom_target(png_scripts_intprefix_out
|
||||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out")
|
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out")
|
||||||
|
|
||||||
@ -472,7 +483,8 @@ else()
|
|||||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out"
|
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out"
|
||||||
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/png.h"
|
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/png.h"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h"
|
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out" pnglibconf_out)
|
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out"
|
||||||
|
pnglibconf_out)
|
||||||
add_custom_target(png_scripts_prefix_out
|
add_custom_target(png_scripts_prefix_out
|
||||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out")
|
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out")
|
||||||
|
|
||||||
@ -484,7 +496,8 @@ else()
|
|||||||
|
|
||||||
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/sym.c"
|
generate_out(INPUT "${CMAKE_CURRENT_SOURCE_DIR}/scripts/sym.c"
|
||||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out"
|
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out"
|
||||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h" pnglibconf_h)
|
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
|
||||||
|
pnglibconf_h)
|
||||||
add_custom_target(png_scripts_sym_out
|
add_custom_target(png_scripts_sym_out
|
||||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out")
|
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out")
|
||||||
|
|
||||||
@ -500,7 +513,8 @@ else()
|
|||||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out"
|
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out"
|
||||||
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/png.h"
|
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/png.h"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h"
|
"${CMAKE_CURRENT_SOURCE_DIR}/pngconf.h"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h" pnglibconf_h)
|
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
|
||||||
|
pnglibconf_h)
|
||||||
add_custom_target(png_scripts_vers_out
|
add_custom_target(png_scripts_vers_out
|
||||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out")
|
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out")
|
||||||
|
|
||||||
@ -533,19 +547,32 @@ else()
|
|||||||
|
|
||||||
# A single target handles generation of all generated files.
|
# A single target handles generation of all generated files.
|
||||||
add_custom_target(png_genfiles
|
add_custom_target(png_genfiles
|
||||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libpng.sym" png_gensym
|
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libpng.sym"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/libpng.vers" png_genvers
|
png_gensym
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c" pnglibconf_c
|
"${CMAKE_CURRENT_BINARY_DIR}/libpng.vers"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h" pnglibconf_h
|
png_genvers
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out" pnglibconf_out
|
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.c"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/pngprefix.h" pngprefix_h
|
pnglibconf_c
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out" png_scripts_intprefix_out
|
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/pnglibconf.c" png_scripts_pnglibconf_c
|
pnglibconf_h
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out" png_scripts_prefix_out
|
"${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.out"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out" png_scripts_sym_out
|
pnglibconf_out
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk" png_scripts_symbols_chk
|
"${CMAKE_CURRENT_BINARY_DIR}/pngprefix.h"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out" png_scripts_symbols_out
|
pngprefix_h
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out" png_scripts_vers_out)
|
"${CMAKE_CURRENT_BINARY_DIR}/scripts/intprefix.out"
|
||||||
|
png_scripts_intprefix_out
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/scripts/pnglibconf.c"
|
||||||
|
png_scripts_pnglibconf_c
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/scripts/prefix.out"
|
||||||
|
png_scripts_prefix_out
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/scripts/sym.out"
|
||||||
|
png_scripts_sym_out
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk"
|
||||||
|
png_scripts_symbols_chk
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out"
|
||||||
|
png_scripts_symbols_out
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out"
|
||||||
|
png_scripts_vers_out)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# List the source code files.
|
# List the source code files.
|
||||||
@ -645,55 +672,60 @@ if(PNG_SHARED)
|
|||||||
add_library(png_shared SHARED ${libpng_sources})
|
add_library(png_shared SHARED ${libpng_sources})
|
||||||
add_dependencies(png_shared png_genfiles)
|
add_dependencies(png_shared png_genfiles)
|
||||||
list(APPEND PNG_LIBRARY_TARGETS png_shared)
|
list(APPEND PNG_LIBRARY_TARGETS png_shared)
|
||||||
set_target_properties(png_shared PROPERTIES
|
set_target_properties(png_shared
|
||||||
OUTPUT_NAME "${PNG_SHARED_OUTPUT_NAME}"
|
PROPERTIES OUTPUT_NAME "${PNG_SHARED_OUTPUT_NAME}"
|
||||||
DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}"
|
DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}"
|
||||||
VERSION "${PNGLIB_SHARED_VERSION}"
|
VERSION "${PNGLIB_SHARED_VERSION}"
|
||||||
SOVERSION "${PNGLIB_ABI_VERSION}")
|
SOVERSION "${PNGLIB_ABI_VERSION}")
|
||||||
if(UNIX AND AWK)
|
if(UNIX AND AWK)
|
||||||
if(HAVE_LD_VERSION_SCRIPT)
|
if(HAVE_LD_VERSION_SCRIPT)
|
||||||
set_target_properties(png_shared PROPERTIES
|
set_target_properties(png_shared
|
||||||
LINK_FLAGS "-Wl,--version-script='${CMAKE_CURRENT_BINARY_DIR}/libpng.vers'")
|
PROPERTIES LINK_FLAGS "-Wl,--version-script='${CMAKE_CURRENT_BINARY_DIR}/libpng.vers'")
|
||||||
elseif(HAVE_SOLARIS_LD_VERSION_SCRIPT)
|
elseif(HAVE_SOLARIS_LD_VERSION_SCRIPT)
|
||||||
set_target_properties(png_shared PROPERTIES
|
set_target_properties(png_shared
|
||||||
LINK_FLAGS "-Wl,-M -Wl,'${CMAKE_CURRENT_BINARY_DIR}/libpng.vers'")
|
PROPERTIES LINK_FLAGS "-Wl,-M -Wl,'${CMAKE_CURRENT_BINARY_DIR}/libpng.vers'")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
# Avoid CMake's implicit compile definition "png_shared_EXPORTS".
|
# Avoid CMake's implicit compile definition "png_shared_EXPORTS".
|
||||||
set_target_properties(png_shared PROPERTIES DEFINE_SYMBOL "")
|
set_target_properties(png_shared
|
||||||
|
PROPERTIES DEFINE_SYMBOL "")
|
||||||
elseif(WIN32)
|
elseif(WIN32)
|
||||||
# Use the explicit compile definition "PNG_BUILD_DLL" for Windows DLLs.
|
# Use the explicit compile definition "PNG_BUILD_DLL" for Windows DLLs.
|
||||||
set_target_properties(png_shared PROPERTIES DEFINE_SYMBOL PNG_BUILD_DLL)
|
set_target_properties(png_shared
|
||||||
|
PROPERTIES DEFINE_SYMBOL PNG_BUILD_DLL)
|
||||||
endif()
|
endif()
|
||||||
target_include_directories(png_shared
|
target_include_directories(png_shared
|
||||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
||||||
target_include_directories(png_shared
|
target_include_directories(png_shared
|
||||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
|
||||||
target_include_directories(png_shared SYSTEM
|
target_include_directories(png_shared
|
||||||
|
SYSTEM
|
||||||
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
|
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
|
||||||
target_link_libraries(png_shared PUBLIC ZLIB::ZLIB ${M_LIBRARY})
|
target_link_libraries(png_shared
|
||||||
|
PUBLIC ZLIB::ZLIB ${M_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(PNG_STATIC)
|
if(PNG_STATIC)
|
||||||
add_library(png_static STATIC ${libpng_sources})
|
add_library(png_static STATIC ${libpng_sources})
|
||||||
add_dependencies(png_static png_genfiles)
|
add_dependencies(png_static png_genfiles)
|
||||||
list(APPEND PNG_LIBRARY_TARGETS png_static)
|
list(APPEND PNG_LIBRARY_TARGETS png_static)
|
||||||
set_target_properties(png_static PROPERTIES
|
set_target_properties(png_static
|
||||||
OUTPUT_NAME "${PNG_STATIC_OUTPUT_NAME}"
|
PROPERTIES OUTPUT_NAME "${PNG_STATIC_OUTPUT_NAME}"
|
||||||
DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}")
|
DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}")
|
||||||
target_include_directories(png_static
|
target_include_directories(png_static
|
||||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
||||||
target_include_directories(png_static
|
target_include_directories(png_static
|
||||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
|
||||||
target_include_directories(png_static SYSTEM
|
target_include_directories(png_static
|
||||||
|
SYSTEM
|
||||||
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
|
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
|
||||||
target_link_libraries(png_static PUBLIC ZLIB::ZLIB ${M_LIBRARY})
|
target_link_libraries(png_static
|
||||||
|
PUBLIC ZLIB::ZLIB ${M_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(PNG_FRAMEWORK AND NOT APPLE)
|
if(PNG_FRAMEWORK AND NOT APPLE)
|
||||||
message(AUTHOR_WARNING
|
message(AUTHOR_WARNING "Setting PNG_FRAMEWORK to OFF, as it only applies to Apple systems")
|
||||||
"Setting PNG_FRAMEWORK to OFF, as it only applies to Apple systems")
|
|
||||||
set(PNG_FRAMEWORK OFF)
|
set(PNG_FRAMEWORK OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -701,25 +733,28 @@ if(PNG_FRAMEWORK)
|
|||||||
add_library(png_framework SHARED ${libpng_sources})
|
add_library(png_framework SHARED ${libpng_sources})
|
||||||
add_dependencies(png_framework png_genfiles)
|
add_dependencies(png_framework png_genfiles)
|
||||||
list(APPEND PNG_LIBRARY_TARGETS png_framework)
|
list(APPEND PNG_LIBRARY_TARGETS png_framework)
|
||||||
set_target_properties(png_framework PROPERTIES
|
set_target_properties(png_framework
|
||||||
FRAMEWORK TRUE
|
PROPERTIES FRAMEWORK TRUE
|
||||||
FRAMEWORK_VERSION "${PNGLIB_VERSION}"
|
FRAMEWORK_VERSION "${PNGLIB_VERSION}"
|
||||||
MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PNGLIB_MAJOR}.${PNGLIB_MINOR}"
|
MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PNGLIB_MAJOR}.${PNGLIB_MINOR}"
|
||||||
MACOSX_FRAMEWORK_BUNDLE_VERSION "${PNGLIB_VERSION}"
|
MACOSX_FRAMEWORK_BUNDLE_VERSION "${PNGLIB_VERSION}"
|
||||||
MACOSX_FRAMEWORK_IDENTIFIER "org.libpng.libpng"
|
MACOSX_FRAMEWORK_IDENTIFIER "org.libpng.libpng"
|
||||||
XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
|
XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
|
||||||
PUBLIC_HEADER "${libpng_public_hdrs}"
|
PUBLIC_HEADER "${libpng_public_hdrs}"
|
||||||
OUTPUT_NAME "png"
|
OUTPUT_NAME "png"
|
||||||
DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}")
|
DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}")
|
||||||
# Avoid CMake's implicit compile definition "-Dpng_framework_EXPORTS".
|
# Avoid CMake's implicit compile definition "-Dpng_framework_EXPORTS".
|
||||||
set_target_properties(png_framework PROPERTIES DEFINE_SYMBOL "")
|
set_target_properties(png_framework
|
||||||
|
PROPERTIES DEFINE_SYMBOL "")
|
||||||
target_include_directories(png_framework
|
target_include_directories(png_framework
|
||||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
||||||
target_include_directories(png_framework
|
target_include_directories(png_framework
|
||||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
|
||||||
target_include_directories(png_framework SYSTEM
|
target_include_directories(png_framework
|
||||||
|
SYSTEM
|
||||||
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
|
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
|
||||||
target_link_libraries(png_framework PUBLIC ZLIB::ZLIB ${M_LIBRARY})
|
target_link_libraries(png_framework
|
||||||
|
PUBLIC ZLIB::ZLIB ${M_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT PNG_LIBRARY_TARGETS)
|
if(NOT PNG_LIBRARY_TARGETS)
|
||||||
@ -746,7 +781,8 @@ if(PNG_TESTS AND PNG_SHARED)
|
|||||||
set(PNGTEST_PNG "${CMAKE_CURRENT_SOURCE_DIR}/pngtest.png")
|
set(PNGTEST_PNG "${CMAKE_CURRENT_SOURCE_DIR}/pngtest.png")
|
||||||
|
|
||||||
add_executable(pngtest ${pngtest_sources})
|
add_executable(pngtest ${pngtest_sources})
|
||||||
target_link_libraries(pngtest PRIVATE png_shared)
|
target_link_libraries(pngtest
|
||||||
|
PRIVATE png_shared)
|
||||||
|
|
||||||
png_add_test(NAME pngtest
|
png_add_test(NAME pngtest
|
||||||
COMMAND pngtest
|
COMMAND pngtest
|
||||||
@ -757,7 +793,8 @@ if(PNG_TESTS AND PNG_SHARED)
|
|||||||
FILES "${TEST_PNG3_PNGS}")
|
FILES "${TEST_PNG3_PNGS}")
|
||||||
|
|
||||||
add_executable(pngvalid ${pngvalid_sources})
|
add_executable(pngvalid ${pngvalid_sources})
|
||||||
target_link_libraries(pngvalid PRIVATE png_shared)
|
target_link_libraries(pngvalid
|
||||||
|
PRIVATE png_shared)
|
||||||
|
|
||||||
png_add_test(NAME pngvalid-gamma-16-to-8
|
png_add_test(NAME pngvalid-gamma-16-to-8
|
||||||
COMMAND pngvalid
|
COMMAND pngvalid
|
||||||
@ -803,7 +840,8 @@ if(PNG_TESTS AND PNG_SHARED)
|
|||||||
OPTIONS --transform)
|
OPTIONS --transform)
|
||||||
|
|
||||||
add_executable(pngstest ${pngstest_sources})
|
add_executable(pngstest ${pngstest_sources})
|
||||||
target_link_libraries(pngstest PRIVATE png_shared)
|
target_link_libraries(pngstest
|
||||||
|
PRIVATE png_shared)
|
||||||
|
|
||||||
foreach(gamma_type 1.8 linear none sRGB)
|
foreach(gamma_type 1.8 linear none sRGB)
|
||||||
foreach(alpha_type none alpha)
|
foreach(alpha_type none alpha)
|
||||||
@ -858,7 +896,8 @@ if(PNG_TESTS AND PNG_SHARED)
|
|||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
add_executable(pngunknown ${pngunknown_sources})
|
add_executable(pngunknown ${pngunknown_sources})
|
||||||
target_link_libraries(pngunknown PRIVATE png_shared)
|
target_link_libraries(pngunknown
|
||||||
|
PRIVATE png_shared)
|
||||||
|
|
||||||
png_add_test(NAME pngunknown-discard
|
png_add_test(NAME pngunknown-discard
|
||||||
COMMAND pngunknown
|
COMMAND pngunknown
|
||||||
@ -874,7 +913,8 @@ if(PNG_TESTS AND PNG_SHARED)
|
|||||||
FILES "${PNGTEST_PNG}")
|
FILES "${PNGTEST_PNG}")
|
||||||
png_add_test(NAME pngunknown-sAPI
|
png_add_test(NAME pngunknown-sAPI
|
||||||
COMMAND pngunknown
|
COMMAND pngunknown
|
||||||
OPTIONS --strict bKGD=save cHRM=save gAMA=save all=discard iCCP=save sBIT=save sRGB=save
|
OPTIONS --strict
|
||||||
|
bKGD=save cHRM=save gAMA=save all=discard iCCP=save sBIT=save sRGB=save
|
||||||
FILES "${PNGTEST_PNG}")
|
FILES "${PNGTEST_PNG}")
|
||||||
png_add_test(NAME pngunknown-save
|
png_add_test(NAME pngunknown-save
|
||||||
COMMAND pngunknown
|
COMMAND pngunknown
|
||||||
@ -890,7 +930,8 @@ if(PNG_TESTS AND PNG_SHARED)
|
|||||||
FILES "${PNGTEST_PNG}")
|
FILES "${PNGTEST_PNG}")
|
||||||
|
|
||||||
add_executable(pngimage ${pngimage_sources})
|
add_executable(pngimage ${pngimage_sources})
|
||||||
target_link_libraries(pngimage PRIVATE png_shared)
|
target_link_libraries(pngimage
|
||||||
|
PRIVATE png_shared)
|
||||||
|
|
||||||
png_add_test(NAME pngimage-quick
|
png_add_test(NAME pngimage-quick
|
||||||
COMMAND pngimage
|
COMMAND pngimage
|
||||||
@ -904,11 +945,13 @@ endif()
|
|||||||
|
|
||||||
if(PNG_SHARED AND PNG_TOOLS)
|
if(PNG_SHARED AND PNG_TOOLS)
|
||||||
add_executable(pngfix ${pngfix_sources})
|
add_executable(pngfix ${pngfix_sources})
|
||||||
target_link_libraries(pngfix PRIVATE png_shared)
|
target_link_libraries(pngfix
|
||||||
|
PRIVATE png_shared)
|
||||||
set(PNG_BIN_TARGETS pngfix)
|
set(PNG_BIN_TARGETS pngfix)
|
||||||
|
|
||||||
add_executable(png-fix-itxt ${png_fix_itxt_sources})
|
add_executable(png-fix-itxt ${png_fix_itxt_sources})
|
||||||
target_link_libraries(png-fix-itxt PRIVATE ZLIB::ZLIB ${M_LIBRARY})
|
target_link_libraries(png-fix-itxt
|
||||||
|
PRIVATE ZLIB::ZLIB ${M_LIBRARY})
|
||||||
list(APPEND PNG_BIN_TARGETS png-fix-itxt)
|
list(APPEND PNG_BIN_TARGETS png-fix-itxt)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -922,12 +965,11 @@ function(create_symlink DEST_FILE)
|
|||||||
# CMake version 3.13.
|
# CMake version 3.13.
|
||||||
cmake_parse_arguments(_SYM "" "FILE;TARGET" "" ${ARGN})
|
cmake_parse_arguments(_SYM "" "FILE;TARGET" "" ${ARGN})
|
||||||
if(NOT _SYM_FILE AND NOT _SYM_TARGET)
|
if(NOT _SYM_FILE AND NOT _SYM_TARGET)
|
||||||
message(FATAL_ERROR "create_symlink: Missing FILE or TARGET argument")
|
message(FATAL_ERROR "create_symlink: Missing arguments: FILE or TARGET")
|
||||||
endif()
|
endif()
|
||||||
if(_SYM_FILE AND _SYM_TARGET)
|
if(_SYM_FILE AND _SYM_TARGET)
|
||||||
message(FATAL_ERROR "create_symlink: "
|
message(FATAL_ERROR "create_symlink: Mutually-exlusive arguments:"
|
||||||
"The arguments FILE (${_SYM_FILE}) and TARGET (${_SYM_TARGET}) "
|
"FILE (${_SYM_FILE}) and TARGET (${_SYM_TARGET})")
|
||||||
"are mutually-exclusive")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(_SYM_FILE)
|
if(_SYM_FILE)
|
||||||
@ -989,11 +1031,11 @@ endif()
|
|||||||
# Only do this on Windows for Cygwin - the files don't make much sense
|
# Only do this on Windows for Cygwin - the files don't make much sense
|
||||||
# outside of a UNIX look-alike.
|
# outside of a UNIX look-alike.
|
||||||
if(NOT WIN32 OR CYGWIN OR MINGW)
|
if(NOT WIN32 OR CYGWIN OR MINGW)
|
||||||
set(prefix ${CMAKE_INSTALL_PREFIX})
|
set(prefix ${CMAKE_INSTALL_PREFIX})
|
||||||
set(exec_prefix ${CMAKE_INSTALL_PREFIX})
|
set(exec_prefix ${CMAKE_INSTALL_PREFIX})
|
||||||
set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
|
set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
|
||||||
set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
|
set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
|
||||||
set(LIBS "-lz -lm")
|
set(LIBS "-lz -lm")
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}.pc
|
${CMAKE_CURRENT_BINARY_DIR}/libpng${PNGLIB_ABI_VERSION}.pc
|
||||||
@ONLY)
|
@ONLY)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user