-
Notifications
You must be signed in to change notification settings - Fork 325
/
CMakeLists.txt
131 lines (119 loc) · 3.3 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
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
119
120
121
122
123
124
125
126
127
128
129
130
131
cmake_minimum_required(VERSION 3.0.0)
project(termux-api)
include(GNUInstallDirs)
set(TERMUX_PREFIX ${CMAKE_INSTALL_PREFIX})
add_library(termux-api SHARED termux-api.c)
add_library(termux-api-static STATIC termux-api.c)
set_target_properties(termux-api-static PROPERTIES OUTPUT_NAME termux-api)
add_executable(termux-api-broadcast termux-api-broadcast.c)
target_link_libraries(termux-api-broadcast termux-api-static)
# TODO: get list through regex or similar
set(script_files
scripts/termux-api-start
scripts/termux-api-stop
scripts/termux-audio-info
scripts/termux-battery-status
scripts/termux-brightness
scripts/termux-call-log
scripts/termux-camera-info
scripts/termux-camera-photo
scripts/termux-clipboard-get
scripts/termux-clipboard-set
scripts/termux-contact-list
scripts/termux-dialog
scripts/termux-download
scripts/termux-fingerprint
scripts/termux-infrared-frequencies
scripts/termux-infrared-transmit
scripts/termux-job-scheduler
scripts/termux-keystore
scripts/termux-location
scripts/termux-media-player
scripts/termux-media-scan
scripts/termux-microphone-record
scripts/termux-nfc
scripts/termux-notification
scripts/termux-notification-channel
scripts/termux-notification-list
scripts/termux-notification-remove
scripts/termux-saf-create
scripts/termux-saf-dirs
scripts/termux-saf-ls
scripts/termux-saf-managedir
scripts/termux-saf-mkdir
scripts/termux-saf-read
scripts/termux-saf-rm
scripts/termux-saf-stat
scripts/termux-saf-write
scripts/termux-sensor
scripts/termux-share
scripts/termux-sms-inbox
scripts/termux-sms-list
scripts/termux-sms-send
scripts/termux-speech-to-text
scripts/termux-storage-get
scripts/termux-telephony-call
scripts/termux-telephony-cellinfo
scripts/termux-telephony-deviceinfo
scripts/termux-toast
scripts/termux-torch
scripts/termux-tts-engines
scripts/termux-tts-speak
scripts/termux-usb
scripts/termux-vibrate
scripts/termux-volume
scripts/termux-wallpaper
scripts/termux-wifi-connectioninfo
scripts/termux-wifi-enable
scripts/termux-wifi-scaninfo
)
make_directory(scripts)
foreach(file ${script_files})
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/${file}.in
${file} @ONLY
)
endforeach()
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/termux-callback.in
termux-callback @ONLY
)
install(
FILES ${CMAKE_BINARY_DIR}/termux-api-broadcast
DESTINATION ${CMAKE_INSTALL_PREFIX}/libexec
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
)
# Create a symlink for termux-api-broadcast->termux-api for backwards
# compatibility
INSTALL(CODE "execute_process( \
COMMAND ${CMAKE_COMMAND} -E create_symlink \
termux-api-broadcast \
${CMAKE_INSTALL_PREFIX}/libexec/termux-api \
)"
)
install(
FILES
${CMAKE_BINARY_DIR}/libtermux-api.so
${CMAKE_BINARY_DIR}/libtermux-api.a
TYPE LIB
)
install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/termux-api.h
TYPE INCLUDE
)
foreach(file ${script_files})
install(
FILES ${CMAKE_BINARY_DIR}/${file}
TYPE BIN
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
)
endforeach()
install(
FILES ${CMAKE_BINARY_DIR}/termux-callback
DESTINATION ${CMAKE_INSTALL_PREFIX}/libexec
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
)