@@ -18,14 +18,6 @@ project(stlink C)
18
18
set (PROJECT_DESCRIPTION "Open source version of the STMicroelectronics ST-LINK Tools" )
19
19
include (GNUInstallDirs) # Define GNU standard installation directories
20
20
21
- set (STLINK_UDEV_RULES_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR} /udev/rules.d" CACHE PATH "udev rules directory" )
22
- option (STLINK_INSTALL_UDEV_RULES "Install udev rules files" ON )
23
-
24
- set (STLINK_MODPROBED_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR} /modprobe.d" CACHE PATH "modprobe.d directory" )
25
- option (STLINK_INSTALL_MODPROBE_CONF "Install modprobe conf files" ON )
26
-
27
- option (STLINK_GENERATE_MANPAGES "Generate manpages with pandoc" OFF )
28
-
29
21
## Determine project version
30
22
include (${CMAKE_MODULE_PATH} /get_version.cmake)
31
23
@@ -271,20 +263,32 @@ else ()
271
263
target_link_libraries (st-util ${STLINK_LIB_SHARED} ${SSP_LIB} )
272
264
endif ()
273
265
266
+ install (TARGETS st-flash DESTINATION bin)
267
+ install (TARGETS st-info DESTINATION bin)
268
+ install (TARGETS st-util DESTINATION bin)
269
+
270
+
271
+ ###
272
+ # udev and modprobe.d configuration
273
+ ###
274
+
274
275
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" )
276
+ ## modprobe.d rules
277
+ set (STLINK_MODPROBED_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR} /modprobe.d" CACHE PATH "modprobe.d directory" )
278
+ option (STLINK_INSTALL_MODPROBE_CONF "Install modprobe conf files" ON )
275
279
if (STLINK_INSTALL_MODPROBE_CONF)
276
- install (FILES etc/modprobe.d/stlink_v1.conf DESTINATION ${STLINK_MODPROBED_DIR} /)
280
+ install (FILES ${CMAKE_SOURCE_DIR} / etc/modprobe.d/stlink_v1.conf DESTINATION ${STLINK_MODPROBED_DIR} /)
277
281
endif ()
282
+
283
+ ## udev rules
284
+ set (STLINK_UDEV_RULES_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR} /udev/rules.d" CACHE PATH "udev rules directory" )
285
+ option (STLINK_INSTALL_UDEV_RULES "Install udev rules files" ON )
278
286
if (STLINK_INSTALL_UDEV_RULES)
279
- file (GLOB RULES_FILES etc/udev/rules.d/*.rules)
287
+ file (GLOB RULES_FILES ${CMAKE_SOURCE_DIR} / etc/udev/rules.d/*.rules)
280
288
install (FILES ${RULES_FILES} DESTINATION ${STLINK_UDEV_RULES_DIR} /)
281
289
endif ()
282
290
endif ()
283
291
284
- install (TARGETS st-flash DESTINATION bin)
285
- install (TARGETS st-info DESTINATION bin)
286
- install (TARGETS st-util DESTINATION bin)
287
-
288
292
289
293
###
290
294
# Additional build tasks
@@ -297,9 +301,11 @@ add_subdirectory(include) # contains subordinate CMakeLists for version config a
297
301
298
302
add_subdirectory (src/stlink-gui) # contains subordinate CMakeLists to build GUI
299
303
add_subdirectory (tests) # contains subordinate CMakeLists to build test executables
300
- add_subdirectory (doc /man) # contains subordinate CMakeLists to generate manpages
301
304
add_subdirectory (cmake/packaging) # contains subordinate CMakeLists to build packages
302
305
306
+ option (STLINK_GENERATE_MANPAGES "Generate manpages with pandoc" OFF )
307
+ add_subdirectory (doc /man) # contains subordinate CMakeLists to generate manpages
308
+
303
309
304
310
###
305
311
# Uninstall target
0 commit comments