[CMake] add version and soversion to base libraries

This commit is contained in:
Mathis Logemann 2021-09-23 10:41:25 +02:00
parent 1c51a8e529
commit a2d3364ec7
5 changed files with 13 additions and 2 deletions

View file

@ -9,4 +9,6 @@ macro(get_mapnik_version)
string(REGEX MATCH "MAPNIK_PATCH_VERSION ([0-9]*)" _ ${VERSION_FILE}) string(REGEX MATCH "MAPNIK_PATCH_VERSION ([0-9]*)" _ ${VERSION_FILE})
set(MAPNIK_PATCH_VERSION ${CMAKE_MATCH_1}) set(MAPNIK_PATCH_VERSION ${CMAKE_MATCH_1})
set(MAPNIK_VERSION ${MAPNIK_MAJOR_VERSION}.${MAPNIK_MINOR_VERSION}.${MAPNIK_PATCH_VERSION})
endmacro() endmacro()

View file

@ -3,8 +3,8 @@ include(CMakePackageConfigHelpers)
# export mapnik configuration # export mapnik configuration
write_basic_package_version_file( write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/mapnikConfigVersion.cmake" "${CMAKE_CURRENT_BINARY_DIR}/mapnikConfigVersion.cmake"
VERSION ${PROJECT_VERSION} VERSION ${MAPNIK_VERSION}
COMPATIBILITY SameMajorVersion COMPATIBILITY ExactVersion
) )
get_property(MAPNIK_UTILITIES GLOBAL PROPERTY MAPNIK_UTILITIES) get_property(MAPNIK_UTILITIES GLOBAL PROPERTY MAPNIK_UTILITIES)
list(JOIN MAPNIK_DEPENDENCIES "\n" MAPNIK_DEPENDENCIES) list(JOIN MAPNIK_DEPENDENCIES "\n" MAPNIK_DEPENDENCIES)

View file

@ -293,6 +293,9 @@ set_target_properties(mapnik PROPERTIES
DEBUG_POSTFIX "${MAPNIK_DEBUG_POSTFIX}" DEBUG_POSTFIX "${MAPNIK_DEBUG_POSTFIX}"
OUTPUT_NAME "mapnik" OUTPUT_NAME "mapnik"
PREFIX "lib" PREFIX "lib"
VERSION ${MAPNIK_VERSION}
# see https://github.com/mapnik/mapnik/pull/4248#issuecomment-925596509 => ABI compability only with the full version
SOVERSION ${MAPNIK_VERSION}
) )
if(MSVC) if(MSVC)

View file

@ -29,6 +29,9 @@ set_target_properties(json PROPERTIES
DEBUG_POSTFIX "${MAPNIK_DEBUG_POSTFIX}" DEBUG_POSTFIX "${MAPNIK_DEBUG_POSTFIX}"
OUTPUT_NAME "json" OUTPUT_NAME "json"
PREFIX "libmapnik-" PREFIX "libmapnik-"
VERSION ${MAPNIK_VERSION}
# see mapnik target for explanation
SOVERSION ${MAPNIK_VERSION}
) )
mapnik_install(json) mapnik_install(json)

View file

@ -21,6 +21,9 @@ set_target_properties(wkt PROPERTIES
DEBUG_POSTFIX "${MAPNIK_DEBUG_POSTFIX}" DEBUG_POSTFIX "${MAPNIK_DEBUG_POSTFIX}"
OUTPUT_NAME "wkt" OUTPUT_NAME "wkt"
PREFIX "libmapnik-" PREFIX "libmapnik-"
VERSION ${MAPNIK_VERSION}
# see mapnik target for explanation
SOVERSION ${MAPNIK_VERSION}
) )
mapnik_install(wkt) mapnik_install(wkt)