From ea63d4f1978ca20339c8e7d336adac05d1b33afb Mon Sep 17 00:00:00 2001 From: Robert Date: Fri, 11 Sep 2020 17:17:44 +0200 Subject: BUILD(cmake): Fix plugins install directory Mumble usually ships with all its plugins in /usr/lib/mumble/* but the new make install target installs them directly into /usr/lib/*. This however can lead to certain files being overwritten. Therefore these paths are changed in order to install these libraries into /usr/lib/mumble/* again. Fixes #4477 --- CMakeLists.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index e17cdd6f6..7bba988b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,6 +35,7 @@ list(APPEND CMAKE_MODULE_PATH include(pkg-utils) include(CTest) include(project-utils) +include(GNUInstallDirs) option(BUILD_TESTING "Build tests." OFF) @@ -84,6 +85,21 @@ endif() include(compiler) include(os) +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + if(UNIX) + # Use default GNU location + set(DEFAULT_LIBDIR "${CMAKE_INSTALL_LIBDIR}/mumble") + else() + # Default to current directory + set(DEFAULT_LIBDIR "./lib/mumble") + endif() +else() + # Use a path relative to the prefix + set(DEFAULT_LIBDIR "${CMAKE_INSTALL_PREFIX}/lib/mumble") +endif() + +set(MUMBLE_INSTALL_LIBDIR "${DEFAULT_LIBDIR}" CACHE STRING "The path to which Mumble will install its plugins") + if (64_BIT) set(ARCH "64bit") else() -- cgit v1.2.3