diff --git a/CMakeLists.txt b/CMakeLists.txt index a31c01b397..3c4529ec92 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,19 +147,18 @@ set_property (GLOBAL PROPERTY OCC_VERSION_MAJOR ${OCC_VERSION_MAJOR}) set_property (GLOBAL PROPERTY OCC_VERSION_MINOR ${OCC_VERSION_MINOR}) set_property (GLOBAL PROPERTY OCC_VERSION_MAINTENANCE ${OCC_VERSION_MAINTENANCE}) -# set soversion variable determining compatibility version on platforms with symlinks -# 0 - for empty, 1 - for major, 2 - for major.minor, 3 - for major.minor.maintenance -if (NOT BUILD_SOVERSION_NUMBERS) - set (BUILD_SOVERSION_NUMBERS "0" CACHE STRING "${BUILD_SOVERSION_NUMBERS_DESCR}" FORCE) - SET_PROPERTY(CACHE BUILD_SOVERSION_NUMBERS PROPERTY STRINGS 0 1 2 3) - +# set the number of version components in shared library names and SONAME +# 0 - for none, 1 - for major, 2 - for major.minor, 3 - for major.minor.maintenance +if ("${BUILD_SOVERSION_NUMBERS}" STREQUAL "") # update default state of soversion on different platforms if (WIN32 OR ANDROID OR EMSCRIPTEN) - set (BUILD_SOVERSION_NUMBERS 0) + set (BUILD_SOVERSION_NUMBERS "0") else() - set (BUILD_SOVERSION_NUMBERS 2) + set (BUILD_SOVERSION_NUMBERS "2") endif() endif() +set (BUILD_SOVERSION_NUMBERS "${BUILD_SOVERSION_NUMBERS}" CACHE STRING "${BUILD_SOVERSION_NUMBERS_DESCR}" FORCE) +set_property (CACHE BUILD_SOVERSION_NUMBERS PROPERTY STRINGS 0 1 2 3) set (INSTALL_TEST_CASES OFF CACHE BOOL "${INSTALL_TEST_CASES_DESCR}") diff --git a/adm/cmake/occt_toolkit.cmake b/adm/cmake/occt_toolkit.cmake index 0722d35863..fe0c85dc52 100644 --- a/adm/cmake/occt_toolkit.cmake +++ b/adm/cmake/occt_toolkit.cmake @@ -204,9 +204,12 @@ elseif (BUILD_SOVERSION_NUMBERS GREATER 0) set (OCC_SOVERSION "${OCC_VERSION_MAJOR}") endif() -set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}" - SOVERSION "${OCC_SOVERSION}" - VERSION "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}") +set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}") +if (BUILD_SOVERSION_NUMBERS GREATER 0 OR WIN32) + set_target_properties (${PROJECT_NAME} PROPERTIES + SOVERSION "${OCC_SOVERSION}" + VERSION "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}") +endif() set (USED_TOOLKITS_BY_CURRENT_PROJECT) set (USED_EXTERNLIB_AND_TOOLKITS) diff --git a/adm/cmake/vardescr.cmake b/adm/cmake/vardescr.cmake index f63b8ca039..bdec79ec27 100644 --- a/adm/cmake/vardescr.cmake +++ b/adm/cmake/vardescr.cmake @@ -25,7 +25,8 @@ set (BUILD_SHARED_LIBRARY_NAME_POSTFIX_DESCR "Append the postfix to names of output libraries") set (BUILD_SOVERSION_NUMBERS_DESCR -"Version numbers to put into SONAME: 0 - for empty, 1 - for major, 2 - for major.minor, 3 - for major.minor.maintenance") +"Number of version components in shared library names and SONAME: 0 - for none, +1 - for major, 2 - for major.minor, 3 - for major.minor.maintenance") set (BUILD_RELEASE_DISABLE_EXCEPTIONS_DESCR "Disables exceptions like Standard_OutOfRange in Release builds. diff --git a/dox/build/build_occt/building_occt.md b/dox/build/build_occt/building_occt.md index 1a87ed5653..f174d2a84c 100644 --- a/dox/build/build_occt/building_occt.md +++ b/dox/build/build_occt/building_occt.md @@ -161,7 +161,7 @@ The following table gives the full list of environment variables used at the con | BUILD_RELEASE_DISABLE_EXCEPTIONS | Boolean | Disables exceptions like Standard_OutOfRange in Release builds. Defines No_Exception macros for Release builds when enabled (default). These exceptions are always enabled in Debug builds, but disabled in Release for better performance | | BUILD_RESOURCES | Boolean | Enables regeneration of OCCT resource files | | BUILD_SHARED_LIBRARY_NAME_POSTFIX | String | Appends the postfix to names of output libraries | -| BUILD_SOVERSION_NUMBERS | String | Version numbers to put into SONAME: 0 for empty, 1 for major, 2 for major.minor, 3 for major.minor.maintenance | +| BUILD_SOVERSION_NUMBERS | String | Number of version components in shared library names and SONAME: 0 for none, 1 for major, 2 for major.minor, 3 for major.minor.maintenance | | CMAKE_CONFIGURATION_TYPES | String | Semicolon-separated CMake configurations | | USE_MMGR_TYPE | String | Select memory manager (NATIVE, FLEXIBLE, TBB, or JEMALLOC) | | USE_GIT_HASH | Boolean | Include the git hash in the OCCT version string |