Adapted for v2 from: From 99729147fa930b8ffed4153dcae2bca62bebcdb0 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 12 Nov 2020 11:26:35 +0100 Subject: [PATCH] add LCB_PLUGINS_DIR option to set directory for IO plugins --- CMakeLists.txt | 1 + cmake/config-cmake.h.in | 4 ++-- plugins/io/libev/CMakeLists.txt | 2 +- plugins/io/libevent/CMakeLists.txt | 2 +- plugins/io/libuv/CMakeLists.txt | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5789bac7..90061ee9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,7 @@ endif() OPTION(LCB_NO_TESTS "Disable building of tests" OFF) OPTION(LCB_NO_TOOLS "Disable building of additional tools" OFF) OPTION(LCB_NO_PLUGINS "Disable the building of IO plugins for external libs" OFF) +SET(LCB_PLUGINS_DIR "libcouchbase" CACHE STRING "Directory for IO plugins") OPTION(LCB_BUILD_LIBEVENT "Build the libevent plugin" ON) OPTION(LCB_BUILD_LIBEV "Build the libev plugin (if available)" ON) OPTION(LCB_BUILD_LIBUV "Build the libuv plugin (if available)" ON) diff --git a/cmake/config-cmake.h.in b/cmake/config-cmake.h.in index 30f66da8..1fc26d2a 100644 --- a/cmake/config-cmake.h.in +++ b/cmake/config-cmake.h.in @@ -58,7 +58,7 @@ #cmakedefine LCB_USE_HDR_HISTOGRAM -#define LCB_LIBDIR "${CMAKE_INSTALL_LIBDIR}/libcouchbase" +#define LCB_LIBDIR "${CMAKE_INSTALL_LIBDIR}/${LCB_PLUGINS_DIR}" #include "config_static.h" #endif diff --git a/plugins/io/libev/CMakeLists.txt b/plugins/io/libev/CMakeLists.txt index c2441d36..cf144f0e 100644 --- a/plugins/io/libev/CMakeLists.txt +++ b/plugins/io/libev/CMakeLists.txt @@ -28,4 +28,4 @@ ENDIF() INSTALL(TARGETS couchbase_libev - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/libcouchbase") + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/${LCB_PLUGINS_DIR}") diff --git a/plugins/io/libevent/CMakeLists.txt b/plugins/io/libevent/CMakeLists.txt index 485d6342..339e5a95 100644 --- a/plugins/io/libevent/CMakeLists.txt +++ b/plugins/io/libevent/CMakeLists.txt @@ -24,7 +24,7 @@ IF(LCB_EMBED_PLUGIN_LIBEVENT) SET(LCB_LINK_SPEC "${LCB_LINKS_SPEC} ${LIBEVENT_LIBRARIES}") ELSE() ADD_LIBRARY(couchbase_libevent SHARED plugin-libevent.c) - INSTALL(TARGETS couchbase_libevent LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/libcouchbase") + INSTALL(TARGETS couchbase_libevent LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/${LCB_PLUGINS_DIR}") TARGET_LINK_LIBRARIES(couchbase_libevent ${LIBEVENT_LIBRARIES}) ENDIF() diff --git a/plugins/io/libuv/CMakeLists.txt b/plugins/io/libuv/CMakeLists.txt index 46c63dd8..9954c0f5 100644 --- a/plugins/io/libuv/CMakeLists.txt +++ b/plugins/io/libuv/CMakeLists.txt @@ -40,5 +40,5 @@ INCLUDE_DIRECTORIES(AFTER ${LIBUV_INCLUDE_DIR}) ADD_DEFINITIONS(-DLIBCOUCHBASE_INTERNAL=1) INSTALL(TARGETS couchbase_libuv - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/libcouchbase" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/${LCB_PLUGINS_DIR}" RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -- 2.25.4