17

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?

2
  • I'm also looking for an answer to this question, I can't find any way to add the system cmake path, as well as LLDB, to AS-v2.2.3 Commented Feb 2, 2017 at 14:52
  • Me too. Although it seems we depend hopelessly on further development of Android Studio that uses (and needs) a handmade fork of an older CMake version, I guess. Commented Aug 12, 2017 at 10:29

1 Answer 1

7

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"

Sign up to request clarification or add additional context in comments.

4 Comments

Just FYI to future others, don't include bin in the path to CMake (e.g. cmake.dir=C\:\\Program Files\\CMake). You can debug this by looking at your idea.log.
Android Studio 3.2.1 I also needed to download ninja.exe and copy it in the cmake bin folder.
@JacobBlock omg I've wasted probably 1-2 hours and given up several times trying to use a modern version of CMake, your comment just solved all my problems. With that in mind I suppose the docs "Point to a CMake installation" could make sense? but the example is always cmake.dir=/path-to-cmake
The default install dir in linux is /usr/local/bin/cmake - I had to make cmake.dir=/usr/local/ because andrroid studio adds /bin/cmake to the end of it...

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.