diff --git a/iiod/CMakeLists.txt b/iiod/CMakeLists.txt index b1c75e814..e9f1e95d8 100644 --- a/iiod/CMakeLists.txt +++ b/iiod/CMakeLists.txt @@ -90,6 +90,11 @@ if(NOT SKIP_INSTALL_ALL) endif() if (WITH_SYSTEMD) + if(${WITH_HWMON}) + set(CMAKE_SERVICE_PATH "ConditionPathExists=|/sys/bus/iio\nConditionPathExists=|/sys/class/hwmon") + else() + set(CMAKE_SERVICE_PATH "ConditionPathExists=/sys/bus/iio") + endif() configure_file(${CMAKE_CURRENT_SOURCE_DIR}/init/iiod.service.cmakein ${PROJECT_BINARY_DIR}/init/iiod.service) install(FILES ${PROJECT_BINARY_DIR}/init/iiod.service DESTINATION ${SYSTEMD_UNIT_INSTALL_DIR}) endif() diff --git a/iiod/init/iiod.service.cmakein b/iiod/init/iiod.service.cmakein index f7c310b5e..b5265ca3e 100644 --- a/iiod/init/iiod.service.cmakein +++ b/iiod/init/iiod.service.cmakein @@ -8,7 +8,7 @@ Description=IIO Daemon Requires=systemd-udev-settle.service After=network.target systemd-udev-settle.service -ConditionPathExists=/sys/bus/iio +@CMAKE_SERVICE_PATH@ [Service] Environment=$IIOD_EXTRA_OPTS=''