aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2024-11-25 04:01:47 +0100
committerPřemysl Eric Janouch <p@janouch.name>2024-11-25 05:46:22 +0100
commite46eee0a7f29081b840155643a8a15ba5951c95e (patch)
tree65f85e70cd4da17370eb1850a917c0f552f8d6d9 /CMakeLists.txt
parentf68bf51234f9bbeb0d18c3ca6d97778dce689c64 (diff)
downloadusb-drivers-e46eee0a7f29081b840155643a8a15ba5951c95e.tar.gz
usb-drivers-e46eee0a7f29081b840155643a8a15ba5951c95e.tar.xz
usb-drivers-e46eee0a7f29081b840155643a8a15ba5951c95e.zip
Import razer-bw-te-ctl
This is for a very old keyboard that I no longer own.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt30
1 files changed, 30 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7ddb1cb..9ce894d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,8 +40,32 @@ if (WITH_LIBUSB)
target_include_directories (elksmart-comm PUBLIC ${libusb_INCLUDE_DIRS})
target_link_directories (elksmart-comm PUBLIC ${libusb_LIBRARY_DIRS})
target_link_libraries (elksmart-comm ${libusb_LIBRARIES})
+
+ list (APPEND targets razer-bw-te-ctl)
+ add_executable (razer-bw-te-ctl razer-bw-te-ctl.c)
+ target_include_directories (razer-bw-te-ctl PUBLIC ${libusb_INCLUDE_DIRS})
+ target_link_directories (razer-bw-te-ctl PUBLIC ${libusb_LIBRARY_DIRS})
+ target_link_libraries (razer-bw-te-ctl ${libusb_LIBRARIES})
+endif ()
+
+# Generate documentation from help output
+find_program (HELP2MAN_EXECUTABLE help2man)
+if (NOT HELP2MAN_EXECUTABLE)
+ message (FATAL_ERROR "help2man not found")
endif ()
+foreach (target ${targets})
+ set (page_output "${PROJECT_BINARY_DIR}/${target}.1")
+ list (APPEND project_MAN_PAGES "${page_output}")
+ add_custom_command (OUTPUT ${page_output}
+ COMMAND ${HELP2MAN_EXECUTABLE} -N
+ "${PROJECT_BINARY_DIR}/${target}" -o ${page_output}
+ DEPENDS ${target}
+ COMMENT "Generating man page for ${target}" VERBATIM)
+endforeach ()
+
+add_custom_target (docs ALL DEPENDS ${project_MAN_PAGES})
+
# The files to be installed
include (GNUInstallDirs)
@@ -55,6 +79,12 @@ install (TARGETS ${targets} DESTINATION ${CMAKE_INSTALL_BINDIR}
SETUID)
install (FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR})
+foreach (page ${project_MAN_PAGES})
+ string (REGEX MATCH "\\.([0-9])$" manpage_suffix "${page}")
+ install (FILES "${page}"
+ DESTINATION "${CMAKE_INSTALL_MANDIR}/man${CMAKE_MATCH_1}")
+endforeach ()
+
# CPack
set (CPACK_PACKAGE_VENDOR "Premysl Eric Janouch")
set (CPACK_PACKAGE_CONTACT "Přemysl Eric Janouch <p@janouch.name>")