print version strings if available

This commit is contained in:
Mathis Logemann 2021-03-25 21:28:41 +01:00
parent 2b977f14c9
commit 1367e7007f
2 changed files with 20 additions and 7 deletions

View file

@ -96,11 +96,14 @@ message(STATUS "Installing plugins to ${PLUGINS_INSTALL_DIR}")
set(FONTS_INSTALL_DIR ${MAPNIK_BIN_DIR}/fonts CACHE STRING "installs the fonts in the specified directory")
message(STATUS "Installing fonts to ${FONTS_INSTALL_DIR}")
# Begin project configuration
mapnik_find_package(ICU REQUIRED COMPONENTS uc i18n data)
mapnik_find_package(Boost 1.74 REQUIRED COMPONENTS filesystem system regex)
if(USE_BOOST_REGEX_ICU_WORKAROUND)
set_property(TARGET Boost::regex PROPERTY INTERFACE_LINK_LIBRARIES)
endif()
mapnik_find_package(Freetype REQUIRED)
mapnik_find_package(harfbuzz CONFIG REQUIRED)
@ -166,41 +169,35 @@ set(MAPNIK_OPTIONAL_LIBS "")
set(MAPNIK_OPTIONAL_LIBS_INCLUDE "")
if(USE_LIBXML2)
message(STATUS "Using LibXml2")
mapnik_find_package(LibXml2 REQUIRED)
list(APPEND MAPNIK_COMPILE_DEFS HAVE_LIBXML2)
list(APPEND MAPNIK_OPTIONAL_LIBS LibXml2::LibXml2)
endif()
if(USE_PNG)
message(STATUS "Using PNG")
mapnik_find_package(PNG REQUIRED)
list(APPEND MAPNIK_COMPILE_DEFS HAVE_PNG)
list(APPEND MAPNIK_OPTIONAL_LIBS PNG::PNG)
endif()
if(USE_JPEG)
message(STATUS "Using JPEG")
mapnik_find_package(JPEG REQUIRED)
list(APPEND MAPNIK_COMPILE_DEFS HAVE_JPEG)
list(APPEND MAPNIK_OPTIONAL_LIBS JPEG::JPEG)
endif()
if(USE_TIFF)
message(STATUS "Using TIFF")
mapnik_find_package(TIFF REQUIRED)
list(APPEND MAPNIK_COMPILE_DEFS HAVE_TIFF)
list(APPEND MAPNIK_OPTIONAL_LIBS TIFF::TIFF)
endif()
if(USE_WEBP)
message(STATUS "Using WEBP")
mapnik_find_package(WebP CONFIG REQUIRED)
list(APPEND MAPNIK_COMPILE_DEFS HAVE_WEBP)
list(APPEND MAPNIK_OPTIONAL_LIBS WebP::webp)
endif()
if(USE_CAIRO)
message(STATUS "Using Cairo renderer")
mapnik_find_package(Cairo REQUIRED)
list(APPEND MAPNIK_COMPILE_DEFS HAVE_CAIRO)
list(APPEND MAPNIK_OPTIONAL_LIBS Cairo::Cairo)
@ -209,7 +206,6 @@ endif()
if(USE_PROJ)
#https://proj.org/development/cmake.html
mapnik_find_package(PROJ REQUIRED)
message(STATUS "Using PROJ version: ${PROJ_VERSION}")
math(EXPR MAPNIK_PROJ_VERSION "${PROJ_VERSION_MAJOR}*10000 + ${PROJ_VERSION_MINOR}*100 + ${PROJ_VERSION_PATCH}" OUTPUT_FORMAT DECIMAL)
list(APPEND MAPNIK_COMPILE_DEFS MAPNIK_USE_PROJ MAPNIK_PROJ_VERSION=${MAPNIK_PROJ_VERSION})
list(APPEND MAPNIK_OPTIONAL_LIBS ${PROJ_LIBRARIES})

View file

@ -1,6 +1,23 @@
macro(mapnik_print_version)
string(TOUPPER ${ARGV0} TLNUP)
set(TLN ${ARGV0})
if(${TLN}_VERSION_STRING)
message(STATUS "Using ${ARGV0} version: ${${TLN}_VERSION_STRING}")
elseif(${TLN}_VERSION)
message(STATUS "Using ${ARGV0} version: ${${TLN}_VERSION}")
elseif(${TLNUP}_VERSION_STRING)
message(STATUS "Using ${ARGV0} version: ${${TLNUP}_VERSION_STRING}")
elseif(${TLNUP}_VERSION)
message(STATUS "Using ${ARGV0} version: ${${TLNUP}_VERSION}")
else()
message(STATUS "Using ${ARGV0}")
endif()
endmacro()
macro(mapnik_find_package)
find_package(${ARGN})
set(MAPNIK_TMP_DEP ${ARGN})
list(JOIN MAPNIK_TMP_DEP " " MAPNIK_TMP_DEP)
list(APPEND MAPNIK_DEPENDENCIES "find_dependency(${MAPNIK_TMP_DEP})")
mapnik_print_version(${ARGV0})
endmacro()