diff --git a/CMakeLists.txt b/CMakeLists.txt index fa4defd3f4..00e18a5fcc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,6 +119,31 @@ else() endif() endif() +# Set the SO version. The SO version must be incremented every time a change +# occurs to the ABI that causes a backward incompatibility. Such changes +# include, exhaustively: +# +# * a change to struct or class layout +# * enum changes that would cause a renumbering of previously published enums +# * a removal of a struct, class, enumeration, or function +# * a change in parameters to a free standing function +# * a removal of a global variable +# +# OTIO currently designates the minor version number for breaking changes, +# e.g. v0.15, v0.16.0, v0.17.0, accordingly the SO version will be incremented +# to match. SO version must be monotically increasing, so the ABI version +# should be computed as: major * 100 + revision. The third digit will never +# implicate an ABI version change. So for example, the following OTIO versions +# would map to these ABI versions: +# +# * v0.18.0 - 18 +# * v0.19.0 - 19 +# * v0.19.1 - 19 # No ABI changes with minor version changes +# * v1.0.0 - 100 +# * v1.1.0 - 101 +# +math(EXPR OTIO_SOVERSION "${OTIO_VERSION_MAJOR} * 100 + ${OTIO_VERSION_MINOR}") + set(OTIO_RESOLVED_CXX_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}") if(OTIO_CXX_INSTALL) diff --git a/src/opentime/CMakeLists.txt b/src/opentime/CMakeLists.txt index b7cc47cf4a..a973d03faa 100644 --- a/src/opentime/CMakeLists.txt +++ b/src/opentime/CMakeLists.txt @@ -24,6 +24,12 @@ set_target_properties(opentime PROPERTIES POSITION_INDEPENDENT_CODE TRUE WINDOWS_EXPORT_ALL_SYMBOLS true) +if(BUILD_SHARED_LIBS) + set_target_properties(opentime PROPERTIES + SOVERSION ${OTIO_SOVERSION} + VERSION ${OTIO_VERSION}) +endif() + if(APPLE) set_target_properties(opentime PROPERTIES INSTALL_NAME_DIR "@loader_path" diff --git a/src/opentimelineio/CMakeLists.txt b/src/opentimelineio/CMakeLists.txt index 728b485cb4..732793f2a4 100644 --- a/src/opentimelineio/CMakeLists.txt +++ b/src/opentimelineio/CMakeLists.txt @@ -98,6 +98,12 @@ set_target_properties(opentimelineio PROPERTIES POSITION_INDEPENDENT_CODE TRUE WINDOWS_EXPORT_ALL_SYMBOLS true) +if(BUILD_SHARED_LIBS) + set_target_properties(opentimelineio PROPERTIES + SOVERSION ${OTIO_SOVERSION} + VERSION ${OTIO_VERSION}) +endif() + if(APPLE) set_target_properties(opentimelineio PROPERTIES INSTALL_NAME_DIR "@loader_path"