Blame SOURCES/rabbitmq-c-static.patch

cb5821
From a8c05cb16afbf852fc584f2c2d31d2f7f0e3a48d Mon Sep 17 00:00:00 2001
cb5821
From: Remi Collet <remi@remirepo.net>
cb5821
Date: Thu, 1 Apr 2021 11:21:36 +0200
cb5821
Subject: [PATCH] add option to install or not the static library
cb5821
cb5821
---
cb5821
 CMakeLists.txt             | 1 +
cb5821
 librabbitmq/CMakeLists.txt | 8 +++++---
cb5821
 2 files changed, 6 insertions(+), 3 deletions(-)
cb5821
cb5821
diff --git a/CMakeLists.txt b/CMakeLists.txt
cb5821
index a9a29fdd..a7cf8f2c 100644
cb5821
--- a/CMakeLists.txt
cb5821
+++ b/CMakeLists.txt
cb5821
@@ -245,6 +245,7 @@ endif()
cb5821
 
cb5821
 option(BUILD_SHARED_LIBS "Build rabbitmq-c as a shared library" ON)
cb5821
 option(BUILD_STATIC_LIBS "Build rabbitmq-c as a static library" ON)
cb5821
+option(INSTALL_STATIC_LIBS "Install rabbitmq-c static library" ON)
cb5821
 
cb5821
 option(BUILD_EXAMPLES "Build Examples" ON)
cb5821
 option(BUILD_TOOLS "Build Tools (requires POPT Library)" ${POPT_FOUND})
cb5821
diff --git a/librabbitmq/CMakeLists.txt b/librabbitmq/CMakeLists.txt
cb5821
index d8dcd262..72b4a875 100644
cb5821
--- a/librabbitmq/CMakeLists.txt
cb5821
+++ b/librabbitmq/CMakeLists.txt
cb5821
@@ -154,9 +154,11 @@ if (BUILD_STATIC_LIBS)
cb5821
         set_target_properties(rabbitmq-static PROPERTIES VERSION ${RMQ_VERSION} SOVERSION ${RMQ_SOVERSION} OUTPUT_NAME rabbitmq)
cb5821
     endif (WIN32)
cb5821
 
cb5821
-    install(TARGETS rabbitmq-static EXPORT "${targets_export_name}"
cb5821
-        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
cb5821
-        )
cb5821
+    if (INSTALL_STATIC_LIBS)
cb5821
+        install(TARGETS rabbitmq-static EXPORT "${targets_export_name}"
cb5821
+            ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
cb5821
+            )
cb5821
+    endif (INSTALL_STATIC_LIBS)
cb5821
 
cb5821
     if (NOT DEFINED RMQ_LIBRARY_TARGET)
cb5821
         set(RMQ_LIBRARY_TARGET rabbitmq-static)