2022-08-25 17:59:29 +00:00
|
|
|
function(mapnik_set_dep_version dep var)
|
|
|
|
string(TOUPPER ${dep} m_package_name_upc)
|
|
|
|
set(m_package_name ${dep})
|
2022-04-22 19:10:42 +00:00
|
|
|
if(${m_package_name}_VERSION_STRING)
|
2022-08-25 17:59:29 +00:00
|
|
|
set(${var} ${${m_package_name}_VERSION_STRING} PARENT_SCOPE)
|
2022-04-22 19:10:42 +00:00
|
|
|
elseif(${m_package_name}_VERSION)
|
2022-08-25 17:59:29 +00:00
|
|
|
set(${var} ${${m_package_name}_VERSION} PARENT_SCOPE)
|
2022-04-22 19:10:42 +00:00
|
|
|
elseif(${m_package_name_upc}_VERSION_STRING)
|
2022-08-25 17:59:29 +00:00
|
|
|
set(${var} ${${m_package_name_upc}_VERSION_STRING} PARENT_SCOPE)
|
2022-04-22 19:10:42 +00:00
|
|
|
elseif(${m_package_name_upc}_VERSION)
|
2022-08-25 17:59:29 +00:00
|
|
|
set(${var} ${${m_package_name_upc}_VERSION} PARENT_SCOPE)
|
|
|
|
endif()
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
function(mapnik_print_package_info dep)
|
|
|
|
message(STATUS "Using ${dep} version: ${mapnik_${dep}_version}")
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
macro(mapnik_find_package dep)
|
|
|
|
find_package(${dep} ${ARGN})
|
|
|
|
if(${dep}_FOUND)
|
|
|
|
list(APPEND mapnik_deps ${dep})
|
|
|
|
|
|
|
|
if(mapnik_${dep}_find_args)
|
|
|
|
list(APPEND mapnik_${dep}_find_args ${ARGN})
|
|
|
|
else()
|
|
|
|
set(mapnik_${dep}_find_args ${ARGN})
|
|
|
|
endif()
|
|
|
|
mapnik_set_dep_version(${dep} mapnik_${dep}_version)
|
|
|
|
|
|
|
|
mapnik_print_package_info(${dep})
|
2021-03-25 20:28:41 +00:00
|
|
|
else()
|
2022-08-25 17:59:29 +00:00
|
|
|
message(STATUS "not found: ${dep}")
|
2021-03-25 20:28:41 +00:00
|
|
|
endif()
|
|
|
|
endmacro()
|
|
|
|
|
2022-08-25 17:59:29 +00:00
|
|
|
macro(mapnik_pkg_check_modules dep)
|
|
|
|
pkg_check_modules(${dep} ${ARGN})
|
|
|
|
if(${dep}_FOUND)
|
|
|
|
list(APPEND mapnik_deps ${dep})
|
|
|
|
|
|
|
|
set(mapnik_${dep}_pkg_args ${ARGN})
|
|
|
|
mapnik_set_dep_version(${dep} mapnik_${dep}_version)
|
|
|
|
|
|
|
|
mapnik_print_package_info(${dep})
|
2021-07-21 18:08:22 +00:00
|
|
|
else()
|
2022-08-25 17:59:29 +00:00
|
|
|
message(STATUS "not found: ${dep}")
|
2021-07-21 18:08:22 +00:00
|
|
|
endif()
|
2021-03-17 21:18:21 +00:00
|
|
|
endmacro()
|
2021-03-26 14:45:15 +00:00
|
|
|
|
|
|
|
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()
|