old CMakeLists.txt
# For more information about using CMake with Android Studio, read the
# documentation: https://d.android.com/studio/projects/add-native-code.html
# Sets the minimum version of CMake required to build the native library.
cmake_minimum_required(VERSION 3.4.1)
set(Ceda_DIR "C:/Program Files/Ceda/android-arm64-v8a/lib/cmake/Ceda")
find_package(Ceda REQUIRED)
set(CEDA_CUSTOM_BUILD_ANDROID ON)
set(BOOST_INCLUDEDIR "C:/cedanet/boost-android/install/arm64-v8a/include")
set(BOOST_LIBRARYDIR "C:/cedanet/boost-android/install/arm64-v8a/lib")
# todo don't want this
cedaFindBoost()
cedaSetSourceRoot("${CMAKE_CURRENT_SOURCE_DIR}/..")
#set(cedanet /home/david/cedanet)
#set(cedacore ../../)
#set( ceda-path /home/david/developer/ceda-android )
#set( ceda-path /home/david/developer/ceda-android )
#set( ceda-lib-path ${ceda-path}/lib/arm64-v8a/Release )
#set( build_pizza /home/david/developer/build_pizza_lib_android )
#set( build_pizza-xcppsource ${build_pizza}/build/xcppsource/Android/Release )
include_directories(${build_pizza-xcppsource}/)
include_directories(${build_pizza-xcppsource}/Acme/Pizza/)
include_directories(${ceda-path}/include/)
include_directories(${build_pizza}/include/)
set( boost-path /home/david/cedanet/boost-android/install/arm64-v8a )
set( boost-lib-path ${boost-path}/lib )
include_directories(${boost-path}/include/)
add_definitions(
-DMAXIMUM_ARCHIVE_COMPRESSION
-DCEDA_CHECK_ASSERTIONS
-DCEDA_ASSERTION_FAILURE_THROWS_EXCEPTION
)
file(GLOB pizza_SRC
"${build_pizza-xcppsource}/Acme/Pizza/*.h"
"${build_pizza-xcppsource}/Acme/Pizza/src/*.h"
"${build_pizza-xcppsource}/Acme/Pizza/src/*.cpp"
)
file(GLOB dt_JNISRC
"src/main/cpp/dt/*.h"
"src/main/cpp/dt/*.cpp"
)
file(GLOB shapes_JNISRC
"src/main/cpp/shapes/*.h"
"src/main/cpp/shapes/*.cpp"
)
file(GLOB pizza_JNISRC
"src/main/cpp/pizza/*.h"
"src/main/cpp/pizza/*.cpp"
)
# Creates and names a library, sets it as either STATIC
# or SHARED, and provides the relative paths to its source code.
# You can define multiple libraries, and CMake builds them for you.
# Gradle automatically packages shared libraries with your APK.
add_library( # Sets the name of the library.
native-lib
# Sets the library as a shared library.
SHARED
# Provides a relative path to your source file(s).
${dt_JNISRC}
${shapes_JNISRC}
${pizza_JNISRC}
src/main/cpp/Utils.cpp
src/main/cpp/CedaJni.cpp
src/main/cpp/PizzaJni.cpp
src/main/cpp/native-lib.cpp )
add_library( pizza SHARED ${pizza_SRC} )
#set(boost-libs ${boost-lib-path}/libboost_system.a
# ${boost-lib-path}/libboost_filesystem.a
# ${boost-lib-path}/libboost_thread.a
# ${boost-lib-path}/libboost_chrono.a
# ${boost-lib-path}/libboost_atomic.a)
# Searches for a specified prebuilt library and stores the path as a
# variable. Because CMake includes system libraries in the search path by
# default, you only need to specify the name of the public NDK library
# you want to add. CMake verifies that the library exists before
# completing its build.
find_library( # Sets the name of the path variable.
log-lib
# Specifies the name of the NDK library that
# you want CMake to locate.
log )
# Specifies libraries CMake should link to your target library. You
# can link multiple libraries, such as libraries you define in this
# build script, prebuilt third-party libraries, or system libraries.
target_link_libraries( pizza
${ceda-lib-path}/libcxUtils.so
${ceda-lib-path}/libcxObject.so
${ceda-lib-path}/libcxPersistStore.so
)
target_link_libraries( # Specifies the target library.
native-lib
pizza
${ceda-lib-path}/libcxLss.so
${ceda-lib-path}/libcxMessage.so
${ceda-lib-path}/libcxObject.so
${ceda-lib-path}/libcxOperation.so
${ceda-lib-path}/libcxPersistStore.so
${ceda-lib-path}/libcxRmi.so
${ceda-lib-path}/libcxSocket.so
${ceda-lib-path}/libcxUtils.so
${ceda-lib-path}/libcxWorkingSetIpc.so
# Links the target library to the log library
# included in the NDK.
${log-lib} )