[cmake] Separate API and ABI versions

This commit is contained in:
evpobr 2021-04-04 19:16:38 +05:00
parent e79f45dac7
commit 9349a566e2

View File

@ -17,6 +17,15 @@ endif ()
project(libsndfile VERSION 1.0.31)
#
# ABI version of library.
#
set (SNDFILE_ABI_VERSION_MAJOR 1)
set (SNDFILE_ABI_VERSION_MINOR 0)
set (SNDFILE_ABI_VERSION_PATCH 31)
set (SNDFILE_ABI_VERSION "${SNDFILE_ABI_VERSION_MAJOR}.${SNDFILE_ABI_VERSION_MINOR}.${SNDFILE_ABI_VERSION_PATCH}")
#
# Variables
#
@ -402,8 +411,8 @@ if (BUILD_SHARED_LIBS)
endif ()
set_target_properties (sndfile PROPERTIES
SOVERSION ${PROJECT_VERSION_MAJOR}
VERSION ${PROJECT_VERSION}
SOVERSION ${SNDFILE_ABI_VERSION_MAJOR}
VERSION ${SNDFILE_ABI_VERSION}
)
# Symbol files generation
@ -425,7 +434,7 @@ if (BUILD_SHARED_LIBS)
if (DEFINED SYMBOL_OS)
add_custom_command (
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/src/${SYMBOL_FILENAME}
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/src/create_symbols_file.py ${SYMBOL_OS} ${PROJECT_VERSION} > ${CMAKE_CURRENT_BINARY_DIR}/src/${SYMBOL_FILENAME}
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/src/create_symbols_file.py ${SYMBOL_OS} ${SNDFILE_ABI_VERSION} > ${CMAKE_CURRENT_BINARY_DIR}/src/${SYMBOL_FILENAME}
COMMENT "Generating ${SYMBOL_FILENAME}..."
)