From 8aa8b706727a6a6a841be42ef35a629ed635db3e Mon Sep 17 00:00:00 2001 From: Juan Orti Alcaine Date: Wed, 5 Feb 2025 10:29:40 +0100 Subject: [PATCH] Use GNUInstallDirs macros Instead of installing to a hardcoded path, use the macros from GNUInstallDirs. This allows proper override of the directories at build time. This was discovered because the package failed to build in Fedora with the bin-sbin merge change: https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin https://bugzilla.redhat.com/show_bug.cgi?id=2340955 Signed-off-by: Juan Orti Alcaine --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 94f279c..3387fd0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,7 +38,8 @@ add_executable(odhcp6c ${SOURCES}) target_link_libraries(odhcp6c ${LIBRARIES}) # Installation -install(TARGETS odhcp6c DESTINATION sbin/) +include(GNUInstallDirs) +install(TARGETS odhcp6c DESTINATION "${CMAKE_INSTALL_SBINDIR}") # Packaging information set(CPACK_PACKAGE_VERSION "1") -- 2.30.2