From 0e58278461e503185476afec24c0a38cff308bab Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 29 Sep 2023 12:07:30 -0400 Subject: [PATCH] Add auto-detection code to find ip and ifconfig --- CMakeLists.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 02c7b929f..88e1a8495 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -707,6 +707,30 @@ if(ZM_PATH_UNAME STREQUAL "") endif() endif() +# Find the path to a uname compatible executable +if(ZM_PATH_IP STREQUAL "") + find_program(IP_EXECUTABLE ip) + if(IP_EXECUTABLE) + set(ZM_PATH_IP "${IP_EXECUTABLE}") + mark_as_advanced(IP_EXECUTABLE) + endif() + if(IP_EXECUTABLE-NOTFOUND) + message(WARNING "Unable to find a compatible ip binary.") + endif() +endif() + +# Find the path to a ifconfig compatible executable +if(ZM_PATH_IFCONFIG STREQUAL "") + find_program(IFCONFIG_EXECUTABLE ifconfig) + if(IFCONFIG_EXECUTABLE) + set(ZM_PATH_IFCONFIG "${IFCONFIG_EXECUTABLE}") + mark_as_advanced(IFCONFIG_EXECUTABLE) + endif() + if(IFCONFIG_EXECUTABLE-NOTFOUND) + message(WARNING "Unable to find a compatible ifconfig binary.") + endif() +endif() + # Some variables that zm expects set(ZM_PID "${ZM_RUNDIR}/zm.pid") set(ZM_CONFIG "${ZM_CONFIG_DIR}/zm.conf")