Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Android Studio use the system CMake?

I'm using Android Studio + CMake to build a native library. AS requested installing CMake, even though I already have CMake installed and in my path. Can you tell AS to look for CMake at a certain location, instead of installing another CMake?

like image 533
user1906 Avatar asked Dec 05 '16 02:12

user1906


People also ask

What is CMake used for in Android Studio?

The Android NDK supports using CMake to compile C and C++ code for your application.

Should I add CMake to path?

The default should be the most common and recommended choice. That ought to be the second one: "Add CMake to the system PATH for all users". In specialized cases where the administrator prefers one of the other options, they may certainly pick those.

Where do I put android NDK?

Go to %userprofile%\AppData\Local\Android\sdk\ndk-bundle and copy . installer folder to desktop and cancel the downloading in SDK manager . Open . installer folder and open .


1 Answers

The new Android plugin for gradle 3.0 will support using system CMake, for CMake 3.7+.

From that webpage:

  1. Download and install CMake 3.7 or higher from the official CMake website.

  2. Include the path to the CMake installation in your project's local.properties file:

    cmake.dir="path-to-cmake"

like image 68
user1906 Avatar answered Oct 12 '22 03:10

user1906