SDL: Fix android build with SDK 37.2: Allow dots in platform directory names and use CMake version comparison

From f034d594a845fcc94e6d2337ddc49769f290d250 Mon Sep 17 00:00:00 2001
From: Sylvain <[EMAIL REDACTED]>
Date: Fri, 4 Sep 2026 19:03:23 +0200
Subject: [PATCH] Fix android build with SDK 37.2: Allow dots in platform
 directory names and use CMake version comparison

---
 cmake/android/FindSdlAndroidPlatform.cmake | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmake/android/FindSdlAndroidPlatform.cmake b/cmake/android/FindSdlAndroidPlatform.cmake
index fbe53c3094ad8..47f1ef8f9dfbe 100644
--- a/cmake/android/FindSdlAndroidPlatform.cmake
+++ b/cmake/android/FindSdlAndroidPlatform.cmake
@@ -65,7 +65,7 @@ function(_sdl_is_valid_android_platform_root RESULT VERSION PLATFORM_ROOT)
     set(result FALSE)
     set(version -1)
 
-    string(REGEX MATCH "/android-([0-9]+)$" root_match "${PLATFORM_ROOT}")
+    string(REGEX MATCH "/android-([0-9][0-9.]*)$" root_match "${PLATFORM_ROOT}")
     if(root_match AND EXISTS "${PLATFORM_ROOT}/android.jar")
         set(result TRUE)
         set(version "${CMAKE_MATCH_1}")
@@ -88,7 +88,7 @@ function(_sdl_find_android_platform_root ROOT)
     set(max_platform_root "")
     foreach(platform_root IN LISTS platform_roots)
       _sdl_is_valid_android_platform_root(is_valid platform_version "${platform_root}")
-      if(is_valid AND platform_version GREATER max_platform_version)
+      if(is_valid AND platform_version VERSION_GREATER max_platform_version)
         set(max_platform_version "${platform_version}")
         set(max_platform_root "${platform_root}")
       endif()