forked from ReimuNotMoe/ydotool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
92 lines (74 loc) · 2.91 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.14)
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})
# Include GNU install directory module to detect where to install
# files on Linux/Unix systems (e.g., lib vs lib64)
include(GNUInstallDirs)
find_package(PkgConfig)
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
)
# Try to get the systemd directory for user units from the package
# and fall back on upstream default without the '/usr' prefix
pkg_check_modules(SYSTEMD systemd)
if (SYSTEMD_FOUND)
pkg_get_variable(SD_UNITDIR systemd systemduserunitdir)
else()
set(SD_UNITDIR "lib/systemd/user")
endif()
set(SOURCE_FILES_LIBRARY
CommonIncludes.hpp
Library/Tool.hpp Library/Tool.cpp
Library/Utils.cpp Library/Utils.hpp
Tools/Tools.hpp
Tools/Sleep/Sleep.hpp Tools/Sleep/Sleep.cpp
Tools/MouseMove/MouseMove.hpp Tools/MouseMove/MouseMove.cpp
Tools/Key/Key.hpp Tools/Key/Key.cpp
Tools/Click/Click.hpp Tools/Click/Click.cpp
Tools/Type/Type.hpp Tools/Type/Type.cpp
Tools/Recorder/Recorder.cpp Tools/Recorder/Recorder.hpp
)
# Library/Transports/UnixSocket.cpp Library/Transports/UnixSocket.hpp )
set(SOURCE_FILES_DAEMON CommonIncludes.hpp Daemon/ydotoold.cpp Daemon/ydotoold.hpp Library/Utils.hpp Library/Utils.cpp)
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 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(Daemon)
add_subdirectory(manpage)