Skip to content

Commit

Permalink
Simple SOVERSION (#3066)
Browse files Browse the repository at this point in the history
Co-authored-by: Bas Couwenberg <sebastic@xs4all.nl>
  • Loading branch information
mwtoews and sebastic authored Feb 23, 2022
1 parent e79984f commit 65c84b6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 25 deletions.
9 changes: 2 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,8 @@ message(STATUS "Configuring PROJ:")
################################################################################
include(ProjVersion)
proj_version(MAJOR 9 MINOR 0 PATCH 0)
# Use libtool convention to build the CMake's VERSION and SOVERSION
# See https://github.com/pvanhoof/dir-examples#cmake-in-the-cmake-example
set(PROJ_LIBTOOL_CURRENT 25)
set(PROJ_LIBTOOL_REVISION 0)
set(PROJ_LIBTOOL_AGE 0)
math(EXPR PROJ_API_VERSION "${PROJ_LIBTOOL_CURRENT} - ${PROJ_LIBTOOL_AGE}")
set(PROJ_BUILD_VERSION "${PROJ_API_VERSION}.${PROJ_LIBTOOL_AGE}.${PROJ_LIBTOOL_REVISION}")
set(PROJ_SOVERSION 25)
set(PROJ_BUILD_VERSION "${PROJ_SOVERSION}.${PROJ_VERSION}")

################################################################################
# Build features and variants
Expand Down
18 changes: 4 additions & 14 deletions HOWTO-RELEASE
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,10 @@ list. The PROJ PSC guidelines describes the rules for passing a motion.
In case of a un-planned maintenance release, make sure that version numbers are
properly updated: see 3.1

Determine the ABI version number. It consists of "current:revision:age". Follow
the steps below to determine the values in CMakeLists.txt:

- If the library source code has changed at all since the last update,
then increment PROJ_LIBTOOL_REVISION (c:r:a becomes c:r+1:a).

- If any interfaces have been added, removed, or changed since the last
update, increment PROJ_LIBTOOL_CURRENT and set PROJ_LIBTOOL_REVISION to 0.

- If any interfaces have been added since the last public release, then
increment PROJ_LIBTOOL_AGE.

- If any interfaces have been removed since the last public release, then
set PROJ_LIBTOOL_AGE to 0.
For each release version, increment PROJ_SOVERSION in CMakeLists.txt if the
ABI is not backwards compatible, i.e. any interfaces have been removed, or
changed since the last release. See also:
https://community.kde.org/Policies/Binary_Compatibility_Issues_With_C%2B%2B

*Commit the changes to master.*

Expand Down
8 changes: 4 additions & 4 deletions src/lib_proj.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -402,21 +402,21 @@ target_include_directories(proj INTERFACE
if(WIN32)
set_target_properties(proj
PROPERTIES
VERSION "${${PROJECT_NAME}_BUILD_VERSION}"
VERSION "${PROJ_VERSION}"
OUTPUT_NAME "${PROJ_CORE_TARGET_OUTPUT_NAME}"
ARCHIVE_OUTPUT_NAME proj
CLEAN_DIRECT_OUTPUT 1)
elseif(BUILD_FRAMEWORKS_AND_BUNDLE)
set_target_properties(proj
PROPERTIES
VERSION "${${PROJECT_NAME}_BUILD_VERSION}"
VERSION "${PROJ_VERSION}"
INSTALL_NAME_DIR ${PROJ_INSTALL_NAME_DIR}
CLEAN_DIRECT_OUTPUT 1)
else()
set_target_properties(proj
PROPERTIES
VERSION "${${PROJECT_NAME}_BUILD_VERSION}"
SOVERSION "${${PROJECT_NAME}_API_VERSION}"
VERSION "${PROJ_BUILD_VERSION}"
SOVERSION "${PROJ_SOVERSION}"
CLEAN_DIRECT_OUTPUT 1)
endif()

Expand Down

0 comments on commit 65c84b6

Please sign in to comment.