1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
| | From f68869deba8b71ff77cc0a2acd22eb449a61f7e9 Mon Sep 17 00:00:00 2001
From: Alexandr Vityazev <avityazev@posteo.org>
Date: Sat, 25 Sep 2021 23:15:15 +0300
Subject: [PATCH] CMakeLists: remove CPM.
- CMakeLists: remove CPM, remove linking cxxopts - header-only library,
- add targets to install binaries;
- ADD: Daemon/80-uinput.rules, Daemon/CMakeLists, manpage/CMakeLists.
---
CMakeLists.txt | 48 ++++++------------------------------------
Daemon/80-uinput.rules | 1 +
Daemon/CMakeLists.txt | 1 +
manpage/CMakeLists.txt | 9 ++++++++
4 files changed, 17 insertions(+), 42 deletions(-)
create mode 100644 Daemon/80-uinput.rules
create mode 100644 Daemon/CMakeLists.txt
create mode 100644 manpage/CMakeLists.txt
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3dd15bf..8a882c5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,41 +3,6 @@ project(ydotool)
set(CMAKE_CXX_STANDARD 17)
-set(CPM_DOWNLOAD_VERSION 0.27.5)
-set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
-
-if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION}))
- message(STATUS "Downloading CPM.cmake")
- file(DOWNLOAD https://github.com/TheLartians/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake ${CPM_DOWNLOAD_LOCATION})
-endif()
-
-include(${CPM_DOWNLOAD_LOCATION})
-
-CPMAddPackage(
- NAME IODash
- GITHUB_REPOSITORY YukiWorkshop/IODash
- VERSION 0.1.0
-)
-
-CPMAddPackage(
- NAME libevdevPlus
- GITHUB_REPOSITORY YukiWorkshop/libevdevPlus
- VERSION 0.2.1
-)
-
-CPMAddPackage(
- NAME libuInputPlus
- GITHUB_REPOSITORY YukiWorkshop/libuInputPlus
- VERSION 0.2.1
-)
-
-CPMAddPackage(
- NAME cxxopts
- GITHUB_REPOSITORY jarro2783/cxxopts
- VERSION 3.0.0
- GIT_TAG 2d8e17c4f88efce80e274cb03eeb902e055a91d3
-)
-
set(SOURCE_FILES_LIBRARY
CommonIncludes.hpp
Library/Tool.hpp Library/Tool.cpp
@@ -59,15 +24,14 @@ set(SOURCE_FILES_CLIENT
CommonIncludes.hpp
Client/ydotool.cpp Client/ydotool.hpp)
-include_directories(${libevdevPlus_SOURCE_DIR})
-include_directories(${libuInputPlus_SOURCE_DIR})
-include_directories(${IODash_SOURCE_DIR})
-include_directories(${IODash_SOURCE_DIR}/cpp_modules/portable-endian) # FIXME
-include_directories(${cxxopts_SOURCE_DIR}/include)
-
add_executable(ydotoold ${SOURCE_FILES_DAEMON})
-target_link_libraries(ydotoold PUBLIC cxxopts uInputPlus evdevPlus)
+target_link_libraries(ydotoold PUBLIC uInputPlus evdevPlus)
+install(TARGETS ydotoold DESTINATION ${CMAKE_INSTALL_BINDIR})
add_library(ydotool_library STATIC ${SOURCE_FILES_LIBRARY})
add_executable(ydotool ${SOURCE_FILES_CLIENT})
target_link_libraries(ydotool ydotool_library dl pthread uInputPlus evdevPlus)
+install(TARGETS ydotool DESTINATION ${CMAKE_INSTALL_BINDIR})
+
+add_subdirectory(manpage)
+add_subdirectory(Daemon)
diff --git a/Daemon/80-uinput.rules b/Daemon/80-uinput.rules
new file mode 100644
index 0000000..fad61d4
--- /dev/null
+++ b/Daemon/80-uinput.rules
@@ -0,0 +1 @@
+KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"
diff --git a/Daemon/CMakeLists.txt b/Daemon/CMakeLists.txt
new file mode 100644
index 0000000..0f478f8
--- /dev/null
+++ b/Daemon/CMakeLists.txt
@@ -0,0 +1 @@
+install(FILES 80-uinput.rules DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/udev/rules.d/)
diff --git a/manpage/CMakeLists.txt b/manpage/CMakeLists.txt
new file mode 100644
index 0000000..c749dfc
--- /dev/null
+++ b/manpage/CMakeLists.txt
@@ -0,0 +1,9 @@
+function(man_page section page)
+ set(src "${CMAKE_CURRENT_SOURCE_DIR}/${page}.${section}.scd")
+ set(bin "${CMAKE_CURRENT_BINARY_DIR}/${page}.${section}")
+ add_custom_target(${page}.${section} ALL COMMAND scdoc < ${src} > ${bin})
+ install(FILES ${bin} DESTINATION ${CMAKE_INSTALL_MANDIR}/man${section}/)
+endfunction(man_page)
+
+man_page(1 ydotool)
+man_page(8 ydotoold)
--
2.33.0
|