From 72870c1ebef904c5bcc0453c3026789aa3c04982 Mon Sep 17 00:00:00 2001 From: Punit Agrawal Date: Thu, 8 Apr 2021 10:38:10 +0900 Subject: [PATCH] src/CMakeLists.txt: Enable multiarch for the cmake files The cmake files install path is hard coded which gets in the way of enabling multiarch. Fix this by respecting the standard CMAKE variable used to specify library install location. This variable gets used during package building to install the cmake files to multiarch aware location. Gbp-Pq: Name 0003-src-CMakeLists.txt-Enable-multiarch-for-the-cmake-fi.patch --- CMakeLists.txt | 4 ++-- src/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ef54e12..4ab2e77 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ find_package(unilog REQUIRED) add_subdirectory(src) file(RELATIVE_PATH REL_INCLUDE_DIR - ${CMAKE_INSTALL_PREFIX}/share/cmake/${PROJECT_NAME} + ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ${CMAKE_INSTALL_PREFIX}/include) set(CONF_INCLUDE_DIRS "\${${PROJECT_NAME}_CMAKE_DIR}/${REL_INCLUDE_DIR}") @@ -42,7 +42,7 @@ write_basic_package_version_file( install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake" - DESTINATION share/cmake/${PROJECT_NAME}) + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) if(BUILD_TEST) add_subdirectory(test) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 217c6bc..668a695 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -67,4 +67,4 @@ install( install( EXPORT ${PROJECT_NAME}-targets NAMESPACE ${PROJECT_NAME}:: - DESTINATION share/cmake/${PROJECT_NAME}) + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) -- 2.30.2