From 55aa84bf6cbbd921ab4d76b8667797217658c591 Mon Sep 17 00:00:00 2001 From: Simon Rit Date: Mon, 10 Oct 2022 09:07:31 +0200 Subject: [PATCH] COMP: Allow install lib directory name changes Follows InsightSoftwareConsortium/ITK@5b09d546666f6110250aa7edbb59d4469791b944 --- CMakeLists.txt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 699a2d634..479eb1c32 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,20 +39,23 @@ set(RTK_LIBRARIES RTK) #========================================================= # Installation variables #========================================================= +if(NOT CMAKE_INSTALL_LIBDIR) + set(CMAKE_INSTALL_LIBDIR lib) +endif() if(NOT RTK_INSTALL_RUNTIME_DIR) set(RTK_INSTALL_RUNTIME_DIR bin) endif() if(NOT RTK_INSTALL_LIB_DIR) - set(RTK_INSTALL_LIB_DIR lib) + set(RTK_INSTALL_LIB_DIR ${CMAKE_INSTALL_LIBDIR}) endif() if(NOT RTK_INSTALL_ARCHIVE_DIR) - set(RTK_INSTALL_ARCHIVE_DIR lib) + set(RTK_INSTALL_ARCHIVE_DIR ${CMAKE_INSTALL_LIBDIR}) endif() if(NOT RTK_INSTALL_INCLUDE_DIR) set(RTK_INSTALL_INCLUDE_DIR include/RTK) endif() if(NOT RTK_INSTALL_PACKAGE_DIR) - set(RTK_INSTALL_PACKAGE_DIR "lib/cmake/RTK") + set(RTK_INSTALL_PACKAGE_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/RTK") endif() #Set position independent code for Unix (-fPIC) @@ -131,10 +134,10 @@ if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${RTK_BINARY_DIR}/bin) endif() if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${RTK_BINARY_DIR}/lib) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${RTK_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) endif() if(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY) - set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${RTK_BINARY_DIR}/lib) + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${RTK_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) endif() #=========================================================