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?
- 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.3coolnodje– coolnodje2017-02-02 14:52:27 +00:00Commented 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.yau– yau2017-08-12 10:29:40 +00:00Commented Aug 12, 2017 at 10:29
Add a comment |
1 Answer
The new Android plugin for gradle 3.0 will support using system CMake, for CMake 3.7+.
From that webpage:
Download and install CMake 3.7 or higher from the official CMake website.
Include the path to the CMake installation in your project's local.properties file:
cmake.dir="path-to-cmake"
4 Comments
Jacob Block
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.Slion
Android Studio 3.2.1 I also needed to download ninja.exe and copy it in the cmake bin folder.
Matt
@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-cmakeLUser
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...