From 2c2ae24d7c70c97f667ed487382e55ec27cfccd2 Mon Sep 17 00:00:00 2001 From: Gabriel Arjones Date: Thu, 18 Oct 2018 10:50:27 -0300 Subject: [PATCH] Make udev rules and modprobe conf installation optional --- CMakeLists.txt | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 395848b0a..a36803ee0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,8 @@ else() endif() option(STLINK_GENERATE_MANPAGES "Generate manpages with pandoc" OFF) +option(STLINK_INSTALL_UDEV_RULES "Install udev rules files" ON) +option(STLINK_INSTALL_MODPROBE_CONF "Install modprobe conf files" ON) if (POLICY CMP0042) # Newer cmake on MacOS should use @rpath @@ -196,11 +198,15 @@ install(TARGETS st-flash st-info ) if (CMAKE_SYSTEM_NAME STREQUAL "Linux") - file(GLOB RULES_FILES etc/udev/rules.d/*.rules) - install(FILES etc/modprobe.d/stlink_v1.conf - DESTINATION ${STLINK_MODPROBED_DIR}/) - install(FILES ${RULES_FILES} - DESTINATION ${STLINK_UDEV_RULES_DIR}/) + if (STLINK_INSTALL_MODPROBE_CONF) + install(FILES etc/modprobe.d/stlink_v1.conf + DESTINATION ${STLINK_MODPROBED_DIR}/) + endif() + if (STLINK_INSTALL_UDEV_RULES) + file(GLOB RULES_FILES etc/udev/rules.d/*.rules) + install(FILES ${RULES_FILES} + DESTINATION ${STLINK_UDEV_RULES_DIR}/) + endif() endif() add_subdirectory(src/gdbserver)