2023-02-02 06:55:38 +00:00
|
|
|
From e1a9b7148e7ae7c55b59249e506d644af38492ed Mon Sep 17 00:00:00 2001
|
2021-04-01 09:52:33 +00:00
|
|
|
From: Remi Collet <remi@remirepo.net>
|
2023-02-02 06:55:38 +00:00
|
|
|
Date: Wed, 1 Feb 2023 16:39:57 +0100
|
2021-04-01 09:52:33 +00:00
|
|
|
Subject: [PATCH] add option to install or not the static library
|
|
|
|
|
|
|
|
---
|
2023-02-02 06:55:38 +00:00
|
|
|
CMakeLists.txt | 3 ++-
|
2021-04-01 09:52:33 +00:00
|
|
|
librabbitmq/CMakeLists.txt | 8 +++++---
|
2023-02-02 06:55:38 +00:00
|
|
|
2 files changed, 7 insertions(+), 4 deletions(-)
|
2021-04-01 09:52:33 +00:00
|
|
|
|
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
2023-02-02 06:55:38 +00:00
|
|
|
index cc61e88f..7b7590f1 100644
|
2021-04-01 09:52:33 +00:00
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2023-02-02 06:55:38 +00:00
|
|
|
@@ -129,6 +129,7 @@ include(CMakeDependentOption)
|
2021-04-01 09:52:33 +00:00
|
|
|
|
|
|
|
option(BUILD_SHARED_LIBS "Build rabbitmq-c as a shared library" ON)
|
|
|
|
option(BUILD_STATIC_LIBS "Build rabbitmq-c as a static library" ON)
|
|
|
|
+option(INSTALL_STATIC_LIBS "Install rabbitmq-c static library" ON)
|
|
|
|
|
2023-02-02 06:55:38 +00:00
|
|
|
option(BUILD_EXAMPLES "Build Examples" OFF)
|
|
|
|
option(BUILD_TOOLS "Build Tools (requires POPT Library)" OFF)
|
|
|
|
@@ -244,7 +245,7 @@ configure_package_config_file(
|
|
|
|
if(BUILD_SHARED_LIBS)
|
|
|
|
list(APPEND INSTALL_TARGETS rabbitmq)
|
|
|
|
endif()
|
|
|
|
-if(BUILD_STATIC_LIBS)
|
|
|
|
+if(BUILD_STATIC_LIBS AND INSTALL_STATIC_LIBS)
|
|
|
|
list(APPEND INSTALL_TARGETS rabbitmq-static)
|
|
|
|
endif()
|
|
|
|
|
2021-04-01 09:52:33 +00:00
|
|
|
diff --git a/librabbitmq/CMakeLists.txt b/librabbitmq/CMakeLists.txt
|
2023-02-02 06:55:38 +00:00
|
|
|
index 1cc58d58..347c992f 100644
|
2021-04-01 09:52:33 +00:00
|
|
|
--- a/librabbitmq/CMakeLists.txt
|
|
|
|
+++ b/librabbitmq/CMakeLists.txt
|
2023-02-02 06:55:38 +00:00
|
|
|
@@ -142,10 +142,12 @@ if(BUILD_STATIC_LIBS)
|
|
|
|
set_target_properties(rabbitmq-static PROPERTIES COMPILE_OPTIONS "/Z7")
|
|
|
|
endif()
|
2021-04-01 09:52:33 +00:00
|
|
|
|
2023-02-02 06:55:38 +00:00
|
|
|
- install(TARGETS rabbitmq-static EXPORT "${targets_export_name}"
|
|
|
|
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
+ if(INSTALL_STATIC_LIBS)
|
|
|
|
+ install(TARGETS rabbitmq-static EXPORT "${targets_export_name}"
|
|
|
|
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
COMPONENT rabbitmq-c-development
|
|
|
|
- )
|
|
|
|
+ )
|
|
|
|
+ endif()
|
2021-04-01 09:52:33 +00:00
|
|
|
|
2023-02-02 06:55:38 +00:00
|
|
|
add_library(rabbitmq::rabbitmq-static ALIAS rabbitmq-static)
|
|
|
|
endif()
|