From 199fd8218bbcfbe8e4456fa66d66fe8efa305087 Mon Sep 17 00:00:00 2001 From: Mathis Logemann Date: Wed, 21 Jul 2021 20:08:22 +0200 Subject: [PATCH] this fixes a bug when including a package via pkg-config: We will append the call to the config file to find the package via find_package. However this does not work when the package was included with pkg-config --- cmake/MapnikFindPackage.cmake | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cmake/MapnikFindPackage.cmake b/cmake/MapnikFindPackage.cmake index a4a10ba7d..8bcd96216 100644 --- a/cmake/MapnikFindPackage.cmake +++ b/cmake/MapnikFindPackage.cmake @@ -16,10 +16,14 @@ 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}) + if(${ARGV0}_FOUND) + 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}) + else() + message(STATUS "not found: ${ARGV0}") + endif() endmacro() macro(mapnik_find_threads)