summaryrefslogtreecommitdiff
path: root/src/contrib/SDL-3.2.20/cmake/android/FindSdlAndroid.cmake
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2025-08-30 16:53:58 -0700
committer3gg <3gg@shellblade.net>2025-08-30 16:53:58 -0700
commit6aaedb813fa11ba0679c3051bc2eb28646b9506c (patch)
tree34acbfc9840e02cb4753e6306ea7ce978bf8b58e /src/contrib/SDL-3.2.20/cmake/android/FindSdlAndroid.cmake
parent8f228ade99dd3d4c8da9b78ade1815c9adf85c8f (diff)
Update to SDL3
Diffstat (limited to 'src/contrib/SDL-3.2.20/cmake/android/FindSdlAndroid.cmake')
-rw-r--r--src/contrib/SDL-3.2.20/cmake/android/FindSdlAndroid.cmake103
1 files changed, 103 insertions, 0 deletions
diff --git a/src/contrib/SDL-3.2.20/cmake/android/FindSdlAndroid.cmake b/src/contrib/SDL-3.2.20/cmake/android/FindSdlAndroid.cmake
new file mode 100644
index 0000000..851848f
--- /dev/null
+++ b/src/contrib/SDL-3.2.20/cmake/android/FindSdlAndroid.cmake
@@ -0,0 +1,103 @@
1#[=======================================================================[
2
3FindSdlAndroid
4----------------------
5
6Locate various executables that are essential to creating an Android APK archive.
7This find module uses the FindSdlAndroidBuildTools module to locate some Android utils.
8
9
10Imported targets
11^^^^^^^^^^^^^^^^
12
13This module defines the following :prop_tgt:`IMPORTED` target(s):
14
15`` SdlAndroid::aapt2 ``
16 Imported executable for the "android package tool" v2
17
18`` SdlAndroid::apksigner``
19 Imported executable for the APK signer tool
20
21`` SdlAndroid::d8 ``
22 Imported executable for the dex compiler
23
24`` SdlAndroid::zipalign ``
25 Imported executable for the zipalign util
26
27`` SdlAndroid::adb ``
28 Imported executable for the "android debug bridge" tool
29
30`` SdlAndroid::keytool ``
31 Imported executable for the keytool, a key and certificate management utility
32
33`` SdlAndroid::zip ``
34 Imported executable for the zip, for packaging and compressing files
35
36Result variables
37^^^^^^^^^^^^^^^^
38
39This module will set the following variables in your project:
40
41`` AAPT2_BIN ``
42 Path of aapt2
43
44`` APKSIGNER_BIN ``
45 Path of apksigner
46
47`` D8_BIN ``
48 Path of d8
49
50`` ZIPALIGN_BIN ``
51 Path of zipalign
52
53`` ADB_BIN ``
54 Path of adb
55
56`` KEYTOOL_BIN ``
57 Path of keytool
58
59`` ZIP_BIN ``
60 Path of zip
61
62#]=======================================================================]
63
64cmake_minimum_required(VERSION 3.7...3.28)
65
66if(NOT PROJECT_NAME MATCHES "^SDL.*")
67 message(WARNING "This module is internal to SDL and is currently not supported.")
68endif()
69
70find_package(SdlAndroidBuildTools MODULE)
71
72function(_sdl_android_find_create_imported_executable NAME)
73 string(TOUPPER "${NAME}" NAME_UPPER)
74 set(varname "${NAME_UPPER}_BIN")
75 find_program("${varname}" NAMES "${NAME}" PATHS ${SDL_ANDROID_BUILD_TOOLS_ROOT})
76 if(EXISTS "${${varname}}" AND NOT TARGET SdlAndroid::${NAME})
77 add_executable(SdlAndroid::${NAME} IMPORTED)
78 set_property(TARGET SdlAndroid::${NAME} PROPERTY IMPORTED_LOCATION "${${varname}}")
79 endif()
80endfunction()
81
82if(SdlAndroidBuildTools_FOUND)
83 _sdl_android_find_create_imported_executable(aapt2)
84 _sdl_android_find_create_imported_executable(apksigner)
85 _sdl_android_find_create_imported_executable(d8)
86 _sdl_android_find_create_imported_executable(zipalign)
87endif()
88
89_sdl_android_find_create_imported_executable(adb)
90_sdl_android_find_create_imported_executable(keytool)
91_sdl_android_find_create_imported_executable(zip)
92include(FindPackageHandleStandardArgs)
93
94find_package_handle_standard_args(SdlAndroid
95 VERSION_VAR
96 REQUIRED_VARS
97 AAPT2_BIN
98 APKSIGNER_BIN
99 D8_BIN
100 ZIPALIGN_BIN
101 KEYTOOL_BIN
102 ZIP_BIN
103)