mapnik/cmake/MapnikFindPackage.cmake
Mathis Logemann 199fd8218b 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
2021-07-21 20:08:22 +02:00

42 lines
1.4 KiB
CMake

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})
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)
find_package(Threads REQUIRED)
if(CMAKE_THREAD_LIBS_INIT)
message(STATUS "Using Threads (system libraries)")
elseif(CMAKE_USE_WIN32_THREADS_INIT)
message(STATUS "Using Threads (win32 threads)")
elseif(CMAKE_USE_PTHREADS_INIT)
message(STATUS "Using Threads (pthread)")
elseif(CMAKE_HP_PTHREADS_INIT)
message(STATUS "Using Threads (HP thread)")
else()
message(STATUS "Using Threads (unknown backend)")
endif()
endmacro()