From cc773eae435d6f685ce2d396b48720625136b1b2 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 28 Sep 2023 12:58:43 -0400 Subject: [PATCH] Add ZM_PATH_RM and ZM_PATH_UNAME to config. --- CMakeLists.txt | 30 ++++++++++++++++++++++++++++++ conf.d/01-system-paths.conf.in | 8 ++++++++ 2 files changed, 38 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 167efc777..ab2d3a6af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,6 +88,8 @@ mark_as_advanced( ZM_PATH_MAP ZM_PATH_ARP ZM_PATH_ARP_SCAN + ZM_PATH_RM + ZM_PATH_UNAME ZM_CONFIG_DIR ZM_CONFIG_SUBDIR ZM_DETECT_SYSTEMD @@ -155,6 +157,10 @@ set(ZM_PATH_ARP "" CACHE PATH "Full path to compatible arp binary. Leave empty for automatic detection.") set(ZM_PATH_ARP_SCAN "" CACHE PATH "Full path to compatible scan_arp binary. Leave empty for automatic detection.") +set(ZM_PATH_RM "" CACHE PATH + "Full path to compatible rm binary. Leave empty for automatic detection.") +set(ZM_PATH_UNAME "" CACHE PATH + "Full path to compatible uname binary. Leave empty for automatic detection.") set(ZM_CONFIG_DIR "/${CMAKE_INSTALL_SYSCONFDIR}" CACHE PATH "Location of ZoneMinder configuration, default system config directory") set(ZM_CONFIG_SUBDIR "${ZM_CONFIG_DIR}/conf.d" CACHE PATH @@ -671,6 +677,30 @@ if(ZM_PATH_ARP_SCAN STREQUAL "") endif() endif() +# Find the path to an rm compatible executable +if(ZM_PATH_RM STREQUAL "") + find_program(RM_EXECUTABLE rm) + if(RM_EXECUTABLE) + set(ZM_PATH_RM "${RM_EXECUTABLE}") + mark_as_advanced(RM_EXECUTABLE) + endif() + if(RM_EXECUTABLE-NOTFOUND) + message(WARNING "Unable to find a compatible rm binary.") + endif() +endif() + +# Find the path to a uname compatible executable +if(ZM_PATH_UNAME STREQUAL "") + find_program(UNAME_EXECUTABLE uname) + if(UNAME_EXECUTABLE) + set(ZM_PATH_UNAME "${UNAME_EXECUTABLE}") + mark_as_advanced(UNAME_EXECUTABLE) + endif() + if(UNAME_EXECUTABLE-NOTFOUND) + message(WARNING "Unable to find a compatible uname binary.") + endif() +endif() + # Some variables that zm expects set(ZM_PID "${ZM_RUNDIR}/zm.pid") set(ZM_CONFIG "${ZM_CONFIG_DIR}/zm.conf") diff --git a/conf.d/01-system-paths.conf.in b/conf.d/01-system-paths.conf.in index 6da92c665..45d992ab5 100644 --- a/conf.d/01-system-paths.conf.in +++ b/conf.d/01-system-paths.conf.in @@ -54,6 +54,14 @@ ZM_PATH_ARP="@ZM_PATH_ARP@" # ZoneMinder will find the arp-scan binary automatically on most systems ZM_PATH_ARP_SCAN="@ZM_PATH_ARP_SCAN@" +# Full path to optional rm binary or just rm to use PATH +# ZoneMinder will find the rm binary automatically on most systems +ZM_PATH_RM="@ZM_PATH_RM@" + +# Full path to optional uname binary or just uname to use PATH +# ZoneMinder will find the rm binary automatically on most systems +ZM_PATH_UNAME="@ZM_PATH_UNAME@" + #Full path to shutdown binary ZM_PATH_SHUTDOWN="@ZM_PATH_SHUTDOWN@"