<div dir="ltr">Either option can work fine. Disclosure: I work on Android Studio and was the one that added CMake support.<div><br></div><div>Option (1) is the way it's designed to work and we're working toward getting rid of the need for the CMake fork. I can't really say when that will happen but if you can get away with an older CMake for now then I'd go this way.</div><div>As you mentioned, option (1) will allow you to view your source file structure in Android Studio, edit files, and debug using the built-in debugging support.<br></div><div><br></div><div>To get option (2) to work, you can use jniDirs setting to tell Android Gradle where to pick up your built .so files (seeĀ <a href="https://stackoverflow.com/questions/21255125/how-can-i-add-so-files-to-an-android-library-project-using-gradle-0-7">https://stackoverflow.com/questions/21255125/how-can-i-add-so-files-to-an-android-library-project-using-gradle-0-7</a>). I'm not aware of any projects that use this approach but it should work in principal.</div><div><br></div><div>I hope this helps,</div><div>Jomo</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 7, 2017 at 11:09 AM, Robert Dailey <span dir="ltr"><<a href="mailto:rcdailey.lists@gmail.com" target="_blank">rcdailey.lists@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Right now I have custom targets set to execute the "ant release"<br>
command after my native targets are built. Part of that command<br>
involves copying *.so files to the libs/armeabi-v7a directory so they<br>
get packaged in an APK.<br>
<br>
When switching to gradle, I have two options:<br>
<br>
1. Gradle drives CMake: This means using Android Studio and being<br>
locked down to Google's fork of CMake which is a few major releases<br>
behind. I see that as a negative.<br>
<br>
2. CMake drives Gradle: This would be the same or similar to what I'm<br>
already doing: The custom targets I have would execute gradle as a<br>
separate build step, instead of running ant commands. I'm not too<br>
familiar with Gradle, so I'm not sure how you tell it where your<br>
shared libraries are for the APK packaging steps.<br>
<br>
Which does everyone recommend? Is anyone using one of these setups<br>
successfully? The downside to option 2 is probably no on-device native<br>
debugging since Android Studio probably can't handle gradle projects<br>
without any external CMake builds set up.<br>
<br>
Would like some general direction & advice before I move away from<br>
ANT. Thanks in advance.<br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/<wbr>CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/cmake</a><br>
</blockquote></div><br></div>