File 0001-feat-Set-SOVERSION-and-LIB_LIB_SUFFIX.patch of Package sdrpp-ce
From 7b81a25389f392ea2905eff6255e63225751b4fe Mon Sep 17 00:00:00 2001
From: Lucas Mulling <lucas.mulling@suse.com>
Date: Sat, 18 Oct 2025 15:38:18 -0300
Subject: [PATCH] feat: Set SOVERSION and LIB_LIB_SUFFIX
* Install to /usr/lib${LIB_LIB_SUFFIX} on linux (most distros that is
/usr/lib64)
* Add project versioning, and set it as the SOVERSION for sdrpp_core
Signed-off-by: Lucas Mulling <lucas.mulling@suse.com>
---
CMakeLists.txt | 5 ++++-
core/CMakeLists.txt | 2 +-
core/src/core.cpp | 5 ++++-
sdrpp_module.cmake | 2 +-
4 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 490ea762..02759946 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,6 @@
cmake_minimum_required(VERSION 3.13)
-project(sdrpp)
+project(sdrpp
+ VERSION 1.2.5)
# Backends
option(OPT_BACKEND_GLFW "Use the GLFW backend" ON)
@@ -348,6 +349,8 @@ else ()
add_executable(sdrpp_ce "src/main.cpp")
endif ()
+set_target_properties(sdrpp_core PROPERTIES SOVERSION ${PROJECT_VERSION})
+target_compile_definitions(sdrpp_core PRIVATE LIB_SUFFIX="${LIB_SUFFIX}")
target_link_libraries(sdrpp_ce PRIVATE sdrpp_core)
# Compiler arguments
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
index e101bb38..2ac74314 100644
--- a/core/CMakeLists.txt
+++ b/core/CMakeLists.txt
@@ -177,4 +177,4 @@ set(CORE_FILES ${RUNTIME_OUTPUT_DIRECTORY} PARENT_SCOPE)
# cmake .. "-DCMAKE_TOOLCHAIN_FILE=C:/dev/vcpkg/scripts/buildsystems/vcpkg.cmake"
# Install directives
-install(TARGETS sdrpp_core DESTINATION lib)
\ No newline at end of file
+install(TARGETS sdrpp_core DESTINATION lib${LIB_SUFFIX})
diff --git a/core/src/core.cpp b/core/src/core.cpp
index bfefe0b3..a22a4966 100644
--- a/core/src/core.cpp
+++ b/core/src/core.cpp
@@ -30,6 +30,9 @@
#define INSTALL_PREFIX "/usr/local"
#else
#define INSTALL_PREFIX "/usr"
+#ifndef LIB_SUFFIX
+#define LIB_SUFFIX ""
+#endif
#endif
#endif
@@ -286,7 +289,7 @@ int sdrpp_main(int argc, char* argv[]) {
defConfig["modulesDirectory"] = root + "/modules";
defConfig["resourcesDirectory"] = root + "/res";
#else
- defConfig["modulesDirectory"] = INSTALL_PREFIX "/lib/sdrpp/plugins";
+ defConfig["modulesDirectory"] = INSTALL_PREFIX "/lib" LIB_SUFFIX "/sdrpp/plugins";
defConfig["resourcesDirectory"] = INSTALL_PREFIX "/share/sdrpp";
#endif
diff --git a/sdrpp_module.cmake b/sdrpp_module.cmake
index a14a1bb8..07735520 100644
--- a/sdrpp_module.cmake
+++ b/sdrpp_module.cmake
@@ -16,4 +16,4 @@ set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
target_compile_options(${PROJECT_NAME} PRIVATE ${SDRPP_MODULE_COMPILER_FLAGS})
# Install directives
-install(TARGETS ${PROJECT_NAME} DESTINATION lib/sdrpp/plugins)
\ No newline at end of file
+install(TARGETS ${PROJECT_NAME} DESTINATION lib${LIB_SUFFIX}/sdrpp/plugins)
--
2.51.0