Skip to content

Commit 4c189d2

Browse files
authored
Use GNUInstallDirs with CACHE variables for install destinations (#1152)
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
1 parent 8068d68 commit 4c189d2

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ option(USE_VENDORED_FLATBUFFERS "Use the bundled version of flatbuffers" ON)
2828
option(USE_VENDORED_MINICORO "Use the bundled version of minicoro" ON)
2929
option(USE_VENDORED_MINITRACE "Use the bundled version of minitrace" ON)
3030

31-
set(BTCPP_LIB_DESTINATION lib)
32-
set(BTCPP_INCLUDE_DESTINATION include)
33-
set(BTCPP_BIN_DESTINATION bin)
31+
include(GNUInstallDirs)
32+
33+
set(BTCPP_LIB_DESTINATION "${CMAKE_INSTALL_LIBDIR}" CACHE STRING "Library installation directory")
34+
set(BTCPP_INCLUDE_DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" CACHE STRING "Header installation directory")
35+
set(BTCPP_BIN_DESTINATION "${CMAKE_INSTALL_BINDIR}" CACHE STRING "Binary installation directory")
3436

3537
set(BASE_FLAGS "")
3638

0 commit comments

Comments
 (0)