#213 Use PNG::PNG for libpng, require cmake 3.5, props Schaich Alonso

This commit is contained in:
gitlost 2020-11-30 15:51:14 +00:00
parent 8e0078695c
commit 6322c0c2b0
2 changed files with 23 additions and 22 deletions

View File

@ -1,7 +1,7 @@
# (c) 2008 by BogDan Vatra < bogdan@licentia.eu >
# vim: set ts=4 sw=4 et :
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.5)
project(zint-package)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

View File

@ -1,4 +1,5 @@
# (c) 2008 by BogDan Vatra < bogdan@licentia.eu >
# vim: set ts=4 sw=4 et :
project(zint)
@ -13,34 +14,34 @@ set(zint_TWODIM_SRCS code16k.c codablock.c dmatrix.c pdf417.c qr.c maxicode.c co
set(zint_OUTPUT_SRCS vector.c ps.c svg.c emf.c bmp.c pcx.c gif.c png.c tif.c raster.c output.c)
set(zint_SRCS ${zint_OUTPUT_SRCS} ${zint_COMMON_SRCS} ${zint_ONEDIM_SRCS} ${zint_POSTAL_SRCS} ${zint_TWODIM_SRCS})
if(PNG_FOUND)
include_directories( ${PNG_INCLUDES} )
else(PNG_FOUND)
if(NOT PNG_FOUND)
add_definitions(-DNO_PNG)
endif(PNG_FOUND)
endif()
add_library(zint SHARED ${zint_SRCS})
if(ZINT_STATIC)
add_library(zint-static STATIC ${zint_SRCS})
endif(ZINT_STATIC)
endif()
set_target_properties(zint PROPERTIES SOVERSION "${ZINT_VERSION_MAJOR}.${ZINT_VERSION_MINOR}"
VERSION ${ZINT_VERSION})
if(PNG_FOUND)
target_link_libraries(zint ${PNG_LIBRARIES} )
endif(PNG_FOUND)
target_link_libraries(zint PNG::PNG)
endif()
if(NOT MSVC)
# Link with standard C math library.
target_link_libraries(zint m)
endif(NOT MSVC)
endif()
if(MSVC)
# "BUILD_SHARED_LIBS" is a CMake defined variable, see documentation.
if(BUILD_SHARED_LIBS)
add_definitions("-DDLL_EXPORT")
endif(BUILD_SHARED_LIBS)
endif(MSVC)
endif()
endif()
install(TARGETS zint ${INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES zint.h DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel)