2021-10-01 20:42:57 +02:00
|
|
|
function(create_pkg_config_file _target _lib_name _description)
|
2021-09-23 18:46:48 +02:00
|
|
|
string(CONFIGURE [[
|
|
|
|
prefix=@CMAKE_INSTALL_PREFIX@
|
|
|
|
exec_prefix=${prefix}
|
|
|
|
includedir=${prefix}/include
|
2024-06-20 17:41:45 +02:00
|
|
|
libdir=${exec_prefix}/@MAPNIK_LIB_DIR@
|
2021-09-23 18:46:48 +02:00
|
|
|
|
|
|
|
Name: @_lib_name@
|
|
|
|
Description: @_description@
|
|
|
|
Version: @MAPNIK_VERSION@
|
2021-10-20 10:20:05 +02:00
|
|
|
Libs: -L"${libdir}" -l$<TARGET_FILE_BASE_NAME:@_target@>$<TARGET_PROPERTY:@_target@,$<CONFIG>_POSTFIX>
|
2024-04-16 20:05:38 +02:00
|
|
|
Cflags: -I"${includedir}" -I"${includedir}/mapnik" ]]
|
2021-09-23 18:46:48 +02:00
|
|
|
_contents @ONLY)
|
|
|
|
|
|
|
|
file(GENERATE
|
2021-10-20 10:20:05 +02:00
|
|
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_lib_name}-$<CONFIG>.pc
|
2021-09-23 18:46:48 +02:00
|
|
|
CONTENT "${_contents}"
|
|
|
|
)
|
|
|
|
install(
|
2021-10-20 10:20:05 +02:00
|
|
|
FILES ${CMAKE_CURRENT_BINARY_DIR}/${_lib_name}-$<CONFIG>.pc
|
2021-09-23 18:46:48 +02:00
|
|
|
DESTINATION ${MAPNIK_PKGCONF_DIR}
|
2021-10-20 10:20:05 +02:00
|
|
|
RENAME ${_lib_name}.pc
|
2021-09-23 18:46:48 +02:00
|
|
|
)
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
function(create_pkg_config_file_mapnik _lib_name _description)
|
2021-10-20 10:20:05 +02:00
|
|
|
get_target_property(m_compile_defs core INTERFACE_COMPILE_DEFINITIONS)
|
|
|
|
string(JOIN " -D" m_str_compile_defs ${m_compile_defs})
|
2022-08-11 22:54:50 +02:00
|
|
|
if(m_str_compile_defs)
|
2021-10-20 10:20:05 +02:00
|
|
|
set(m_str_compile_defs "-D${m_str_compile_defs}")
|
2021-09-23 18:46:48 +02:00
|
|
|
endif()
|
2021-10-20 10:20:05 +02:00
|
|
|
|
2022-08-11 22:54:50 +02:00
|
|
|
set(m_requires
|
2021-10-20 10:20:05 +02:00
|
|
|
libmapnikwkt
|
|
|
|
libmapnikjson
|
|
|
|
icu-uc
|
|
|
|
icu-i18n
|
|
|
|
harfbuzz
|
|
|
|
freetype2
|
|
|
|
)
|
|
|
|
if(USE_LIBXML2)
|
|
|
|
list(APPEND m_requires libxml-2.0)
|
|
|
|
endif()
|
|
|
|
if(USE_PNG)
|
|
|
|
list(APPEND m_requires libpng)
|
|
|
|
endif()
|
|
|
|
if(USE_JPEG)
|
|
|
|
list(APPEND m_requires libjpeg)
|
|
|
|
endif()
|
|
|
|
if(USE_TIFF)
|
|
|
|
list(APPEND m_requires libtiff-4)
|
|
|
|
endif()
|
|
|
|
if(USE_WEBP)
|
|
|
|
list(APPEND m_requires libwebp)
|
|
|
|
endif()
|
|
|
|
if(USE_CAIRO)
|
|
|
|
list(APPEND m_requires cairo)
|
|
|
|
endif()
|
|
|
|
if(USE_PROJ)
|
|
|
|
list(APPEND m_requires "proj >= ${PROJ_MIN_VERSION}")
|
|
|
|
endif()
|
|
|
|
string(JOIN " " m_requires ${m_requires})
|
2021-09-23 18:46:48 +02:00
|
|
|
string(CONFIGURE [[
|
|
|
|
prefix=@CMAKE_INSTALL_PREFIX@
|
|
|
|
exec_prefix=${prefix}
|
|
|
|
includedir=${prefix}/include
|
2024-06-20 17:41:45 +02:00
|
|
|
libdir=${exec_prefix}/@MAPNIK_LIB_DIR@
|
2023-03-01 19:40:40 +01:00
|
|
|
fonts_dir=${prefix}/@FONTS_INSTALL_DIR@
|
|
|
|
plugins_dir=${prefix}/@PLUGINS_INSTALL_DIR@
|
2021-09-23 18:46:48 +02:00
|
|
|
|
|
|
|
Name: @_lib_name@
|
|
|
|
Description: @_description@
|
|
|
|
Version: @MAPNIK_VERSION@
|
2021-10-20 10:20:05 +02:00
|
|
|
Requires: @m_requires@
|
|
|
|
Libs: -L"${libdir}" -l$<TARGET_FILE_BASE_NAME:mapnik>$<TARGET_PROPERTY:mapnik,$<CONFIG>_POSTFIX>
|
2024-04-16 20:05:38 +02:00
|
|
|
Cflags: -I"${includedir}" -I"${includedir}/mapnik" -I"${includedir}/mapnik/agg" @m_str_compile_defs@]]
|
2021-09-23 18:46:48 +02:00
|
|
|
_contents @ONLY)
|
|
|
|
file(GENERATE
|
2021-10-20 10:20:05 +02:00
|
|
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_lib_name}-$<CONFIG>.pc
|
2021-09-23 18:46:48 +02:00
|
|
|
CONTENT "${_contents}"
|
|
|
|
)
|
|
|
|
install(
|
2021-10-20 10:20:05 +02:00
|
|
|
FILES ${CMAKE_CURRENT_BINARY_DIR}/${_lib_name}-$<CONFIG>.pc
|
2021-09-23 18:46:48 +02:00
|
|
|
DESTINATION ${MAPNIK_PKGCONF_DIR}
|
2021-10-20 10:20:05 +02:00
|
|
|
RENAME ${_lib_name}.pc
|
2021-09-23 18:46:48 +02:00
|
|
|
)
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
|
2021-10-01 20:42:57 +02:00
|
|
|
create_pkg_config_file(wkt libmapnikwkt "wkt library")
|
|
|
|
create_pkg_config_file(json libmapnikjson "json library")
|
2021-09-23 18:46:48 +02:00
|
|
|
create_pkg_config_file_mapnik("libmapnik" "mapnik library")
|