Android Studio CMake Version

697 views
Skip to first unread message

Leo Li

unread,
Dec 21, 2017, 3:05:56 PM12/21/17
to android-ndk
Hi,

I'm trying to use some new features in CMake and it requires cmake 3.7.1 which is higher than the cmake provided by SDK tools. Following this instruction https://developer.android.com/studio/projects/add-native-code.html#vanilla_cmake, I found that the cmake from upstream doesn't have generator "Android Gradle - Ninja". Do you have any plan to upgrade the build-in cmake or is there a way to extend upstream cmake to support the generator.


Thanks,
Leo

Steven Winston

unread,
Dec 22, 2017, 10:27:26 AM12/22/17
to android-ndk
I'm going to assume you're on a Mac. The issue is ninja might be in your console path but not in your gui path.
What version of osx are you on? Apple changed how to set the path for gui.

Leo Li

unread,
Dec 27, 2017, 3:21:54 PM12/27/17
to android-ndk
I'm actually using windows and I don't see "Android Gradle - Ninja" shown in documents. https://cmake.org/cmake/help/git-stage/manual/cmake-generators.7.html

Leo

Steven Winston

unread,
Dec 28, 2017, 4:44:56 PM12/28/17
to android-ndk
Hi Leo,

Sorry about that.  I had assumed you were on OSX as if you have everything setup correctly and didn't realize there's two paths, you'd have this confusing bug.

The way cmake works is it will look for your system's path.  You could easily point cmake to where you have ninja installed.  You could also use a different generator (the link you helpfully provided tells you how to use a different generator).  Or you could ensure that the system path has a ninja executable in it so cmake can find it itself.
I personally would recommend pointing cmake at your specific ninja executable.  If you're trying to use a system cmake, then you should ensure that cmake is all setup to work for building with ninja independently of Android Studio. If you can do that then you should be golden.

Also please note, I don't work for Google, am just a community member that has gotten this to work in Windows, OSX and Linux.  OSX was the tricky one; windows and linux are able to find the path correctly.

--
You received this message because you are subscribed to a topic in the Google Groups "android-ndk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-ndk/BsKl9kBz4RU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-ndk+unsubscribe@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/0e18c12d-f332-444e-89e6-3b4af52a2edf%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages