Atlas - FindSdlAndroid.cmake

Home / ext / SDL / cmake / android Lines: 1 | Size: 2666 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)]
[FILE BEGIN]
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) 104
[FILE END]
(C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.