From 320c15940902258dc232e0de9a09619fddcb9b9d Mon Sep 17 00:00:00 2001 From: Paul Wise Date: Thu, 25 Nov 2021 12:22:11 +0800 Subject: [PATCH] Install executable using GNUInstallDirs and CMAKE_INSTALL_SBINDIR The executable should not be in /usr/sbin as that is for packages only. Using GNUInstallDirs gives the right dir by default and allows distros to install into /usr/sbin when they want. Fixes: https://github.com/otakuto/crazydiskinfo/issues/29 --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index be93e0f..bc4b7f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,4 +6,5 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11") SET_TARGET_PROPERTIES(CrazyDiskInfo PROPERTIES OUTPUT_NAME crazy) target_link_libraries(CrazyDiskInfo atasmart) target_link_libraries(CrazyDiskInfo ncursesw) -INSTALL(TARGETS CrazyDiskInfo RUNTIME DESTINATION /usr/sbin) +include(GNUInstallDirs) +INSTALL(TARGETS CrazyDiskInfo RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR})