|
| 1 | +cmake_minimum_required(VERSION 3.0.0) |
| 2 | +project(termux-api) |
| 3 | +include(GNUInstallDirs) |
| 4 | + |
| 5 | +add_executable(termux-api termux-api.c) |
| 6 | + |
| 7 | +set(TERMUX_PREFIX ${CMAKE_INSTALL_PREFIX}) |
| 8 | + |
| 9 | +# TODO: get list through regex or similar |
| 10 | +set(script_files |
| 11 | + scripts/termux-audio-info |
| 12 | + scripts/termux-battery-status |
| 13 | + scripts/termux-brightness |
| 14 | + scripts/termux-call-log |
| 15 | + scripts/termux-camera-info |
| 16 | + scripts/termux-camera-photo |
| 17 | + scripts/termux-clipboard-get |
| 18 | + scripts/termux-clipboard-set |
| 19 | + scripts/termux-contact-list |
| 20 | + scripts/termux-dialog |
| 21 | + scripts/termux-download |
| 22 | + scripts/termux-fingerprint |
| 23 | + scripts/termux-infrared-frequencies |
| 24 | + scripts/termux-infrared-transmit |
| 25 | + scripts/termux-job-scheduler |
| 26 | + scripts/termux-keystore |
| 27 | + scripts/termux-location |
| 28 | + scripts/termux-media-player |
| 29 | + scripts/termux-media-scan |
| 30 | + scripts/termux-microphone-record |
| 31 | + scripts/termux-nfc |
| 32 | + scripts/termux-notification |
| 33 | + scripts/termux-notification-list |
| 34 | + scripts/termux-notification-remove |
| 35 | + scripts/termux-sensor |
| 36 | + scripts/termux-share |
| 37 | + scripts/termux-sms-inbox |
| 38 | + scripts/termux-sms-list |
| 39 | + scripts/termux-sms-send |
| 40 | + scripts/termux-speech-to-text |
| 41 | + scripts/termux-storage-get |
| 42 | + scripts/termux-telephony-call |
| 43 | + scripts/termux-telephony-cellinfo |
| 44 | + scripts/termux-telephony-deviceinfo |
| 45 | + scripts/termux-toast |
| 46 | + scripts/termux-torch |
| 47 | + scripts/termux-tts-engines |
| 48 | + scripts/termux-tts-speak |
| 49 | + scripts/termux-usb |
| 50 | + scripts/termux-vibrate |
| 51 | + scripts/termux-volume |
| 52 | + scripts/termux-wallpaper |
| 53 | + scripts/termux-wifi-connectioninfo |
| 54 | + scripts/termux-wifi-enable |
| 55 | + scripts/termux-wifi-scaninfo |
| 56 | +) |
| 57 | + |
| 58 | +make_directory(scripts) |
| 59 | +foreach(file ${script_files}) |
| 60 | + configure_file( |
| 61 | + ${CMAKE_CURRENT_SOURCE_DIR}/${file}.in |
| 62 | + ${file} @ONLY |
| 63 | + ) |
| 64 | +endforeach() |
| 65 | + |
| 66 | +install( |
| 67 | + FILES ${CMAKE_BINARY_DIR}/termux-api |
| 68 | + DESTINATION ${CMAKE_INSTALL_PREFIX}/libexec |
| 69 | + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE |
| 70 | + GROUP_READ GROUP_EXECUTE |
| 71 | + WORLD_READ WORLD_EXECUTE |
| 72 | +) |
| 73 | + |
| 74 | +foreach(file ${script_files}) |
| 75 | + install( |
| 76 | + FILES ${CMAKE_BINARY_DIR}/${file} |
| 77 | + TYPE BIN |
| 78 | + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE |
| 79 | + ) |
| 80 | +endforeach() |
0 commit comments