svn commit: r1921145 - in /subversion/trunk: CMakeLists.txt build/generator/templates/targets.cmake.ezt

[email protected]
Newsgroups gmane.comp.version-control.subversion.svn
Message-ID <[email protected]>
Author: rinrab
Date: Sun Oct  6 09:53:34 2024
New Revision: 1921145

URL: http://svn.apache.org/viewvc?rev=1921145&view=rev
Log:
cmake: Include ABI version number in library names.

This will build the following layout of the libraries and symlinks:

libsvn_client-1.so        -> libsvn_client-1.so
libsvn_client-1.so.1      -> libsvn_client-1.so.1.0.0
libsvn_client-1.so.1.0.0  (the library itself)

* build/generator/templates/targets.cmake.ezt
  (libs): Setup SOVERSION and VERSION properties. Then CMake will the
   required work automatically.
* CMakeLists.txt
  (options): Define SVN_SOVERSION option to make it customizable and to be
   specified once.
  (SVN_SOVERSION definition): Use SVN_SOVERSION, since it got factored out
   from here.

Modified:
    subversion/trunk/CMakeLists.txt
    subversion/trunk/build/generator/templates/targets.cmake.ezt

Modified: subversion/trunk/CMakeLists.txt
URL: http://svn.apache.org/viewvc/subversion/trunk/CMakeLists.txt?rev=1921145&r1=1921144&r2=1921145&view=diff
==============================================================================
--- subversion/trunk/CMakeLists.txt (original)
+++ subversion/trunk/CMakeLists.txt Sun Oct  6 09:53:34 2024
@@ -101,6 +101,8 @@ cmake_dependent_option(SVN_BUILD_SHARED_
 option(SVN_DEBUG "Enables specific features for developer builds" OFF)
 cmake_dependent_option(SVN_USE_WIN32_CRASHHANDLER "Enables WIN32 crash handler." ON "WIN32" OFF)
 option(SVN_USE_DSO "Defined if svn should try to load DSOs" OFF)
+set(SVN_SOVERSION "1" CACHE STRING "Subversion library ABI version")
+mark_as_advanced(SVN_SOVERSION)
 
 # Dependecies
 option(SVN_USE_INTERNAL_LZ4 "Use internal version of lz4" ON)
@@ -158,7 +160,7 @@ string(APPEND PRIVATE_CONFIG_DEFINITIONS
   "/* Shared library file name suffix format */\n"
   "#define SVN_DSO_SUFFIX_FMT \"%d${CMAKE_SHARED_LIBRARY_SUFFIX}\"\n"
 )
-add_compile_definitions("SVN_SOVERSION=1")
+add_compile_definitions("SVN_SOVERSION=${SVN_SOVERSION}")
 
 if (SVN_ENABLE_TESTS)
   enable_testing()

Modified: subversion/trunk/build/generator/templates/targets.cmake.ezt
URL: http://svn.apache.org/viewvc/subversion/trunk/build/generator/templates/targets.cmake.ezt?rev=1921145&r1=1921144&r2=1921145&view=diff
==============================================================================
--- subversion/trunk/build/generator/templates/targets.cmake.ezt (original)
+++ subversion/trunk/build/generator/templates/targets.cmake.ezt Sun Oct  6 09:53:34 2024
@@ -49,7 +49,8 @@ if ([targets.enable_condition])[is targe
     [targets.msvc_export][end]
   )[end]
   set_target_properties([targets.name] PROPERTIES OUTPUT_NAME "[targets.output_name]")[if-any targets.is_apache_mod]
-  set_target_properties([targets.name] PROPERTIES PREFIX "" SUFFIX ".so")[end]
+  set_target_properties([targets.name] PROPERTIES PREFIX "" SUFFIX ".so")[else]
+  set_target_properties([targets.name] PROPERTIES SOVERSION "${SVN_SOVERSION}" VERSION "${SVN_SOVERSION}.0.0")[end]
   target_include_directories([targets.name] PUBLIC
     "${CMAKE_CURRENT_SOURCE_DIR}/subversion/include"
   )[if-any targets.group]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.