Added details from #820

Now describes manual parameter changes required in CMakeLists.txt, how to change ndk-build options, and how to integrate the generated files into an Android Studio project.
This commit is contained in:
Daniel Sabatino
2015-10-09 20:21:18 -04:00
parent 6475d35538
commit fcf4b19ee1

View File

@@ -19,13 +19,28 @@ Linux & OSX
* Install NDK from here: https://developer.android.com/ndk/downloads/index.html
* Do the build with something like:
* To Build
# Check out the sources for CoolProp
git clone https://github.com/CoolProp/CoolProp --recursive
# Move into the folder you just created
# Open the CMakeLists.txt file in the CoolProp directory for editing
# Within the COOLPROP_ANDROID_MODULE modify the command: set(ANDROID_PACKAGE_NAME "CoolProp") to reflect your package name
# Make and move into a build folder
mkdir -p CoolProp/build && cd CoolProp/build
# If a target architecture other than the default (armeabi) is desired, the ndk-build can be modified by editing wrappers/Android/Android.mk.template. For details see https://developer.android.com/ndk/guides/index.html
# Construct the makefile using CMake
cmake .. -DCOOLPROP_ANDROID_MODULE=ON -DNDK_PATH=~/Downloads/android-ndk-r10e
cmake .. -DCOOLPROP_ANDROID_MODULE=ON -DNDK_PATH=~/Downloads/android-ndk-r10e (change path based on your installation)
# Now actually do the build
cmake --build .
cmake --build .
* To Incorporate into an Android Studio Project
# Copy the java files from the package directory (i.e build/com/example/myprogram) to the pacakge directory of the android proejct
# Copy the the build/libs/armeabi folder containing the .so file to the app/src/main/jniLibs folder of the Android Project (you may have reate the jniLibs folder).
# In the main activity of the Android Project add:
static {
System.loadLibrary("CoolProp");
}
# Now CoolProp functions can be called as described in the java wrapper documentation.