From c178acb93452d3063c5058bf8d43877a727d6aab Mon Sep 17 00:00:00 2001 From: Wook Song Date: Sun, 14 Jun 2026 18:02:32 +0900 Subject: [PATCH] Use GNUInstallDirs with CACHE variables for install destinations Replace hardcoded `set()` with `set(... CACHE STRING ...)` defaulting to GNUInstallDirs values. This allows Debian/Ubuntu packagers to override installation directories (e.g. `-DBTCPP_LIB_DESTINATION=lib/x86_64-linux-gnu`) for multiarch support while preserving backward compatibility. Fixes #1120 --- CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 416c2c332..da6c5501b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,9 +28,11 @@ option(USE_VENDORED_FLATBUFFERS "Use the bundled version of flatbuffers" ON) option(USE_VENDORED_MINICORO "Use the bundled version of minicoro" ON) option(USE_VENDORED_MINITRACE "Use the bundled version of minitrace" ON) -set(BTCPP_LIB_DESTINATION lib) -set(BTCPP_INCLUDE_DESTINATION include) -set(BTCPP_BIN_DESTINATION bin) +include(GNUInstallDirs) + +set(BTCPP_LIB_DESTINATION "${CMAKE_INSTALL_LIBDIR}" CACHE STRING "Library installation directory") +set(BTCPP_INCLUDE_DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" CACHE STRING "Header installation directory") +set(BTCPP_BIN_DESTINATION "${CMAKE_INSTALL_BINDIR}" CACHE STRING "Binary installation directory") set(BASE_FLAGS "")