[Android] buildsystem: use the system CMake if it exists

Steve Lhomme git at videolan.org
Fri Feb 13 07:51:44 UTC 2026


vlc-android | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Jul  4 16:29:29 2025 +0200| [858c624f94abe9532dd7e973c3f3fb5a6148f7f4] | committer: Steve Lhomme

buildsystem: use the system CMake if it exists

No need for gradle to install one.

> https://code.videolan.org/videolan/vlc-android/commit/858c624f94abe9532dd7e973c3f3fb5a6148f7f4
---

 buildsystem/compile.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/buildsystem/compile.sh b/buildsystem/compile.sh
index cbcfe07781..eac53a2a33 100755
--- a/buildsystem/compile.sh
+++ b/buildsystem/compile.sh
@@ -203,6 +203,10 @@ init_local_props() {
     echo_props() {
         echo "sdk.dir=$ANDROID_SDK"
         echo "android.ndkPath=$ANDROID_NDK"
+        if [ $(command -v cmake) >/dev/null 2>&1 ]; then
+            # prefix of the cmake installation, not the cmake path or the dir that contains the cmake executable
+            echo "cmake.dir=$(dirname $(dirname $(command -v cmake)))"
+        fi
     }
     # first check if the file just needs to be created for the first time
     if [ ! -f "$1" ]; then
@@ -241,7 +245,8 @@ init_local_props() {
         while IFS= read -r LINE || [ -n "$LINE" ]; do
             line_sdk_dir="${LINE#sdk.dir=}"
             line_ndk_dir="${LINE#android.ndkPath=}"
-            if [ "x$line_sdk_dir" = "x$LINE" ] && [ "x$line_ndk_dir" = "x$LINE" ]; then
+            line_cmake_dir="${LINE#cmake.dir=}"
+            if [ "x$line_sdk_dir" = "x$LINE" ] && [ "x$line_ndk_dir" = "x$LINE" ] && [ "x$line_cmake_dir" = "x$LINE" ]; then
                 echo "$LINE"
             fi
         done <"$1" >"$temp_props"



More information about the Android mailing list