Blame SOURCES/rabbitmq-c-static.patch

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