From fe43824c98a91798455c3ad799b5212a015ae8f3 Mon Sep 17 00:00:00 2001 From: Martchus Date: Tue, 4 Feb 2020 15:30:01 +0100 Subject: [PATCH] Allow passing LIB_INSTALL_DIR as well That variable (but not `CMAKE_INSTALL_LIBDIR`) is apparently passed when building for Fedora with the `%cmake` RPM macro. --- cmake/modules/BasicConfig.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmake/modules/BasicConfig.cmake b/cmake/modules/BasicConfig.cmake index 78d36e3..d7e0c75 100644 --- a/cmake/modules/BasicConfig.cmake +++ b/cmake/modules/BasicConfig.cmake @@ -69,11 +69,15 @@ elseif (CONFIGURATION_TARGET_SUFFIX) set(TARGET_SUFFIX "-${CONFIGURATION_TARGET_SUFFIX}") endif () -# find standard installation directories - note: Allow overriding CMAKE_INSTALL_LIBDIR but don't use the default from -# GNUInstallDirs (as an Arch Linux user this feels odd and I also want to avoid breaking existing build scripts). -set(CMAKE_INSTALL_LIBDIR +# find standard installation directories - note: Allow overriding CMAKE_INSTALL_LIBDIR and LIB_INSTALL_DIR but don't use the +# default from GNUInstallDirs (as an Arch Linux user this feels odd and I also want to avoid breaking existing build +# scripts). +set(LIB_INSTALL_DIR "lib" CACHE STRING "sets the directory to install libraries to (within the prefix)") +set(CMAKE_INSTALL_LIBDIR + "${LIB_INSTALL_DIR}" + CACHE STRING "sets the directory to install libraries to (within the prefix)") include(GNUInstallDirs) # define a few variables