mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
#213 Use PNG::PNG for libpng, require cmake 3.5, props Schaich Alonso
This commit is contained in:
parent
8e0078695c
commit
6322c0c2b0
@ -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)
|
||||
|
@ -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)
|
||||
add_definitions (-DNO_PNG)
|
||||
endif(PNG_FOUND)
|
||||
if(NOT PNG_FOUND)
|
||||
add_definitions(-DNO_PNG)
|
||||
endif()
|
||||
|
||||
add_library(zint SHARED ${zint_SRCS})
|
||||
if(ZINT_STATIC)
|
||||
add_library(zint-static STATIC ${zint_SRCS})
|
||||
endif(ZINT_STATIC)
|
||||
|
||||
set_target_properties(zint PROPERTIES SOVERSION "${ZINT_VERSION_MAJOR}.${ZINT_VERSION_MINOR}"
|
||||
VERSION ${ZINT_VERSION})
|
||||
if(ZINT_STATIC)
|
||||
add_library(zint-static STATIC ${zint_SRCS})
|
||||
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)
|
||||
# Link with standard C math library.
|
||||
target_link_libraries(zint m)
|
||||
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)
|
||||
# "BUILD_SHARED_LIBS" is a CMake defined variable, see documentation.
|
||||
if(BUILD_SHARED_LIBS)
|
||||
add_definitions("-DDLL_EXPORT")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
install(TARGETS zint ${INSTALL_TARGETS_DEFAULT_ARGS} )
|
||||
install(TARGETS zint ${INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
install(FILES zint.h DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel)
|
||||
|
Loading…
Reference in New Issue
Block a user