From 5948091c654c7a6ed0af5b8bffc2bc1d9171b08e Mon Sep 17 00:00:00 2001 From: akallabeth Date: Tue, 26 Aug 2025 15:23:15 +0200 Subject: [PATCH] [cmake] split versioning * WITH_LIBRARY_VERSIONING appends the major version to the name * WITH_LIBRARY_SOVERSIONING enables SOVERSION on platforms supporting it --- cmake/AddTargetWithResourceFile.cmake | 2 +- cmake/CommonConfigOptions.cmake | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/AddTargetWithResourceFile.cmake b/cmake/AddTargetWithResourceFile.cmake index 91cdd0e61..a4066e2e4 100644 --- a/cmake/AddTargetWithResourceFile.cmake +++ b/cmake/AddTargetWithResourceFile.cmake @@ -76,7 +76,7 @@ macro(AddTargetWithResourceFile nameAndTarget is_exe version sources) message("add_library(${target}) [${lib_options}]") add_library(${target} ${lib_options} ${${sources}}) - if(VERSIONING) + if(WITH_LIBRARY_SOVERSIONING) set_target_properties(${target} PROPERTIES VERSION ${version} SOVERSION ${RC_VERSION_MAJOR}) else() set_target_properties(${target} PROPERTIES PREFIX "") diff --git a/cmake/CommonConfigOptions.cmake b/cmake/CommonConfigOptions.cmake index 8d66ac984..f4257453d 100644 --- a/cmake/CommonConfigOptions.cmake +++ b/cmake/CommonConfigOptions.cmake @@ -1,7 +1,8 @@ option(CMAKE_COLOR_MAKEFILE "colorful CMake makefile" ON) option(CMAKE_VERBOSE_MAKEFILE "verbose CMake makefile" ON) option(CMAKE_POSITION_INDEPENDENT_CODE "build with position independent code (-fPIC or -fPIE)" ON) -option(WITH_LIBRARY_VERSIONING "Use library version triplet" ON) +option(WITH_LIBRARY_VERSIONING "Append library major version to name" ON) +option(WITH_LIBRARY_SOVERSIONING "Use library SO version triplet" ON) option(WITH_BINARY_VERSIONING "Use binary versioning" OFF) option(WITH_RESOURCE_VERSIONING "Use resource versioning" OFF) option(BUILD_SHARED_LIBS "Build shared libraries" ON)