<div dir="ltr">yes basically<div><br></div><div>INSTALL( PROGRAMS .... ) keeps file permissions instead of INSTALL( FILES ... ) which loses file permisisons</div><div><br></div><div>You don't nessiciarly have to run it by hand, can add a target that could be built...</div>
<div><br></div><div>There is a little more work associated with release APK....</div><div><br></div><div>---------------</div><div><div><br></div><div>if( CMAKE_BUILD_TYPE STREQUAL "release" )</div><div>  set( MORE_COMMANDS </div>
<div>       COMMAND jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ${MY_KEYSTORE} bin/${Project}-${CMAKE_BUILD_TYPE}-unsigned.apk alias_name</div><div>       COMMAND rm -f bin/${Project}-${CMAKE_BUILD_TYPE}.apk</div>
<div>       COMMAND zipalign -v 4 bin/${Project}-${CMAKE_BUILD_TYPE}-unsigned.apk bin/${Project}-${CMAKE_BUILD_TYPE}.apk</div><div>     )</div><div>endif( CMAKE_BUILD_TYPE STREQUAL "release" )</div><div><br></div>
<div>    add_custom_target( package_apk</div><div>       COMMAND android.bat update project --target "android-14" --path .</div><div>       COMMAND ant.bat ${CMAKE_BUILD_TYPE}</div><div>       ${MORE_COMMANDS}</div>
<div>       WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/package )</div><div><br></div><div><br></div><div>    add_custom_target( install_apk</div><div>    <span class="" style="white-space:pre">                        </span>COMMAND echo adb install command...</div>
<div>                     COMMAND adb install package/bin/${Project}-${CMAKE_BUILD_TYPE}.apk</div><div> )</div><div><br></div><div>    add_custom_target( uninstall_apk</div><div>    <span class="" style="white-space:pre">                     </span>COMMAND echo adb uninstall command...</div>
<div>                     COMMAND adb uninstall org.d3x0r.${Project}</div><div> )</div><div><br></div></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 8, 2014 at 6:43 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">So basically I am thinking of doing this:<br>
<br>
1. Build my NDK libraries using the android cmake toolchain file as if<br>
I'm just building normal C++ libraries on Linux with the CMake<br>
provided makefiles in the binary output directory.<br>
2. Create a Java project using the 'android create project' tool and<br>
check that into version control. The 'libs' directory will be empty.<br>
3. When building the NDK libraries, "install" them to the<br>
corresponding libs directory for that java project (I may need to<br>
install the same library multiple times if multiple java projects<br>
depend on it).<br>
4. Run 'ant' by hand to build the java project.<br>
<br>
Likewise I think I can import all projects into eclipse: Import the<br>
cmake build directory, and then each project in the source tree for<br>
the java side. That way I can work with it all together in the same<br>
IDE.<br>
<br>
Does this sound feasible or am I missing steps?<br>
<div class="HOEnZb"><div class="h5"><br>
On Wed, May 7, 2014 at 10:10 PM, J Decker <<a href="mailto:d3ck0r@gmail.com">d3ck0r@gmail.com</a>> wrote:<br>
> by putting them in a directory <lib/<cputype><br>
><br>
><br>
><br>
> On Wed, May 7, 2014 at 5:19 PM, Robert Dailey <<a href="mailto:rcdailey.lists@gmail.com">rcdailey.lists@gmail.com</a>><br>
> wrote:<br>
>><br>
>> How do I tell my android Java project where the *.so files are so it<br>
>> can package them into the APK for dynamic loading when I call<br>
>> System.loadlibrary() on the SO files?<br>
>><br>
>> On Tue, May 6, 2014 at 6:59 PM, Eric Wing <<a href="mailto:ewmailing@gmail.com">ewmailing@gmail.com</a>> wrote:<br>
>> > So I have 4 examples I actually tried to document.<br>
>> > These all use my fork/derivative of the Android-CMake toolchain, which<br>
>> > I believe comes from OpenCV. (It had grown stale with later NDKs and I<br>
>> > hit problems). All of these rely heavily on the external NDK module<br>
>> > system (NDK_MODULE_PATH).<br>
>> ><br>
>> > The first and easiest (most self contained) is:<br>
>> > <a href="https://bitbucket.org/ewing/hello-android-almixer" target="_blank">https://bitbucket.org/ewing/hello-android-almixer</a><br>
>> > This one invokes ant via shell scripts outside CMake.<br>
>> ><br>
>> > I then recently got SDL building with CMake using the same techniques.<br>
>> > <a href="https://bitbucket.org/ewing/sdl_android_cleanup" target="_blank">https://bitbucket.org/ewing/sdl_android_cleanup</a><br>
>> > This one doesn't invoke ant because it builds only a library. There<br>
>> > was actually an intermediate project I helped build after ALmixer that<br>
>> > this also drew from, JavaScriptCore, and I documented my procedure<br>
>> > here:<br>
>> ><br>
>> > <a href="https://github.com/appcelerator/hyperloop/wiki/Building-JavaScriptCore-for-Android" target="_blank">https://github.com/appcelerator/hyperloop/wiki/Building-JavaScriptCore-for-Android</a><br>
>> ><br>
>> ><br>
>> > Once you have SDL built, and you set your NDK_MODULE_PATH directly, I<br>
>> > have an Ant example and Gradle example. The ant one is just like<br>
>> > Hello-Android-ALmixer.<br>
>> > <a href="https://bitbucket.org/ewing/helloandroidsdl-ant" target="_blank">https://bitbucket.org/ewing/helloandroidsdl-ant</a><br>
>> > <a href="https://bitbucket.org/ewing/helloandroidsdl-gradle" target="_blank">https://bitbucket.org/ewing/helloandroidsdl-gradle</a><br>
>> ><br>
>> > The Gradle one is a lot of hacks. Google is ditching Ant/Eclipse for<br>
>> > Gradle/IntelliJ, but their NDK support is even worse in the latter<br>
>> > right now.<br>
>> ><br>
>> > Again, once you leave the NDK, all these things live outside CMake. I<br>
>> > think it would be interesting to make CMake handle all of this, but I<br>
>> > can't visualize it yet. But I hope others might be able to build on my<br>
>> > work, like how I've built on Android-CMake.<br>
>> ><br>
>> > An aside, I noticed Gradle is painfully slow. Depending on how one<br>
>> > does CMake integration, I'm not sure I want it. Just to invoke it and<br>
>> > for it to figure out no real work needs to be done is measured in<br>
>> > seconds for me.<br>
>> ><br>
>> ><br>
>> > Thanks,<br>
>> > Eric<br>
>> ><br>
>> ><br>
>> ><br>
>> > On 5/6/14, J Decker <<a href="mailto:d3ck0r@gmail.com">d3ck0r@gmail.com</a>> wrote:<br>
>> >> This is a page on building to android; mostly it's about my library,<br>
>> >> but<br>
>> >> names can be replaced where required<br>
>> >><br>
>> >> <a href="https://code.google.com/p/c-system-abstraction-component-gui/wiki/BuildingForAndroid" target="_blank">https://code.google.com/p/c-system-abstraction-component-gui/wiki/BuildingForAndroid</a><br>

>> >><br>
>> >> I went wit the separate cmake projects because I end up with multiple<br>
>> >> android projects from the same libraries; but really it could be<br>
>> >> appended<br>
>> >> all-together<br>
>> >><br>
>> >><br>
>> >> On Tue, May 6, 2014 at 2:32 PM, Robert Dailey<br>
>> >> <<a href="mailto:rcdailey.lists@gmail.com">rcdailey.lists@gmail.com</a>>wrote:<br>
>> >><br>
>> >>> Well to be clear, the NDK libraries are compiled in eclipse after I<br>
>> >>> generate eclipse makefiles in CMake. Ideally, I want the CMake script<br>
>> >>> to also configure "ant" execution so that it builds java and links in<br>
>> >>> the NDK libraries. You say "just use the libraries", but I'm not sure<br>
>> >>> what this looks like as far as CMake script is concerned.<br>
>> >>><br>
>> >>> Also I think we're using the android glue stuff in our existing<br>
>> >>> project, but I'm not really sure what android glue is or if it is<br>
>> >>> relevant to the CMake setup.<br>
>> >>><br>
>> >>> On Tue, May 6, 2014 at 2:45 PM, J Decker <<a href="mailto:d3ck0r@gmail.com">d3ck0r@gmail.com</a>> wrote:<br>
>> >>> > If you've built the sources into libs, you can just use the lib; my<br>
>> >>> sources<br>
>> >>> > are much too complex of a tree for ndk to support to build as<br>
>> >>> > sources..<br>
>> >>> ><br>
>> >>> > The java sources are compiled at the 'ant <debug/release' step...<br>
>> >>> > there<br>
>> >>> is a<br>
>> >>> > step before that I do that is 'android.bat update project --target<br>
>> >>> > "android-14" --path' which makes a few other files from the<br>
>> >>> > build.xml.<br>
>> >>> ><br>
>> >>> ><br>
>> >>> > On Tue, May 6, 2014 at 8:42 AM, Robert Dailey<br>
>> >>> > <<a href="mailto:rcdailey.lists@gmail.com">rcdailey.lists@gmail.com</a>><br>
>> >>> > wrote:<br>
>> >>> >><br>
>> >>> >> There is also the question of how to handle the NDK sources and<br>
>> >>> >> integrate them into the eclipse workspace. For example, I believe<br>
>> >>> >> NDK<br>
>> >>> >> sources must be under the 'jni' directory, but they won't be<br>
>> >>> >> structured that way in the source tree. So I'm not sure if the jni<br>
>> >>> >> directory is required. I realize there's some reference material<br>
>> >>> >> out<br>
>> >>> >> there but I'm not sure what to pay attention to. Would be nice to<br>
>> >>> >> get<br>
>> >>> >> some overview steps that I can read along with the reference<br>
>> >>> >> material<br>
>> >>> >> so I know the order in which to look at things, essentially.<br>
>> >>> >><br>
>> >>> >> On Tue, May 6, 2014 at 10:32 AM, Bill Hoffman<br>
>> >>> >> <<a href="mailto:bill.hoffman@kitware.com">bill.hoffman@kitware.com</a><br>
>> >>> ><br>
>> >>> >> wrote:<br>
>> >>> >> > You can look at what we did for VES:<br>
>> >>> >> > <a href="http://www.kitware.com/blog/home/post/642" target="_blank">http://www.kitware.com/blog/home/post/642</a><br>
>> >>> >> ><br>
>> >>> >> ><br>
>> >>> >> > -Bill<br>
>> >>> >> ><br>
>> >>> >> ><br>
>> >>> >> ><br>
>> >>> >> > --<br>
>> >>> >> ><br>
>> >>> >> > Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>> >>> >> ><br>
>> >>> >> > Please keep messages on-topic and check the CMake FAQ at:<br>
>> >>> >> > <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
>> >>> >> ><br>
>> >>> >> > Kitware offers various services to support the CMake community.<br>
>> >>> >> > For<br>
>> >>> more<br>
>> >>> >> > information on each offering, please visit:<br>
>> >>> >> ><br>
>> >>> >> > CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
>> >>> >> > CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
>> >>> >> > CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
>> >>> >> ><br>
>> >>> >> > Visit other Kitware open-source projects at<br>
>> >>> >> > <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>> >>> >> ><br>
>> >>> >> > Follow this link to subscribe/unsubscribe:<br>
>> >>> >> > <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
>> >>> >> --<br>
>> >>> >><br>
>> >>> >> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>> >>> >><br>
>> >>> >> Please keep messages on-topic and check the CMake FAQ at:<br>
>> >>> >> <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
>> >>> >><br>
>> >>> >> Kitware offers various services to support the CMake community. For<br>
>> >>> >> more<br>
>> >>> >> information on each offering, please visit:<br>
>> >>> >><br>
>> >>> >> CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
>> >>> >> CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
>> >>> >> CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
>> >>> >><br>
>> >>> >> Visit other Kitware open-source projects at<br>
>> >>> >> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>> >>> >><br>
>> >>> >> Follow this link to subscribe/unsubscribe:<br>
>> >>> >> <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
>> >>> ><br>
>> >>> ><br>
>> >>><br>
>> >><br>
>> ><br>
>> ><br>
>> > --<br>
>> > Beginning iPhone Games Development<br>
>> > <a href="http://playcontrol.net/iphonegamebook/" target="_blank">http://playcontrol.net/iphonegamebook/</a><br>
>> > --<br>
>> ><br>
>> > Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>> ><br>
>> > Please keep messages on-topic and check the CMake FAQ at:<br>
>> > <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
>> ><br>
>> > Kitware offers various services to support the CMake community. For more<br>
>> > information on each offering, please visit:<br>
>> ><br>
>> > CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
>> > CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
>> > CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
>> ><br>
>> > Visit other Kitware open-source projects at<br>
>> > <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>> ><br>
>> > Follow this link to subscribe/unsubscribe:<br>
>> > <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
>> --<br>
>><br>
>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>><br>
>> Please keep messages on-topic and check the CMake FAQ at:<br>
>> <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
>><br>
>> Kitware offers various services to support the CMake community. For more<br>
>> information on each offering, please visit:<br>
>><br>
>> CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
>> CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
>> CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
>><br>
>> Visit other Kitware open-source projects at<br>
>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>><br>
>> Follow this link to subscribe/unsubscribe:<br>
>> <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
><br>
><br>
</div></div></blockquote></div><br></div>