mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 04:03:35 +02:00
modify apk.cmake to allow caller to include jar libs
This commit is contained in:
parent
52750f1ec5
commit
c3f57cd07f
2 changed files with 13 additions and 1 deletions
|
@ -68,7 +68,7 @@ set(ANDROID_THIS_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) # Directory this CMake fil
|
||||||
## - "jarsigner" (part of the JDK)
|
## - "jarsigner" (part of the JDK)
|
||||||
## - "zipalign" (part of the Android SDK)
|
## - "zipalign" (part of the Android SDK)
|
||||||
##################################################
|
##################################################
|
||||||
macro(android_create_apk name apk_directory shared_libraries assets data_directory)
|
macro(android_create_apk name apk_directory shared_libraries jar_libraries assets data_directory)
|
||||||
if(ANDROID_APK_CREATE)
|
if(ANDROID_APK_CREATE)
|
||||||
# Construct the current package name and theme
|
# Construct the current package name and theme
|
||||||
set(ANDROID_APK_PACKAGE "${ANDROID_APK_TOP_LEVEL_DOMAIN}.${ANDROID_APK_DOMAIN}.${ANDROID_APK_SUBDOMAIN}")
|
set(ANDROID_APK_PACKAGE "${ANDROID_APK_TOP_LEVEL_DOMAIN}.${ANDROID_APK_DOMAIN}.${ANDROID_APK_SUBDOMAIN}")
|
||||||
|
@ -127,6 +127,15 @@ macro(android_create_apk name apk_directory shared_libraries assets data_directo
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${value} "${apk_directory}/libs/${ARM_TARGET}"
|
COMMAND ${CMAKE_COMMAND} -E copy ${value} "${apk_directory}/libs/${ARM_TARGET}"
|
||||||
)
|
)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
# Copy any required external jars to the libs folder
|
||||||
|
foreach(value ${jar_libraries})
|
||||||
|
add_custom_command(TARGET ${ANDROID_NAME}
|
||||||
|
POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy ${value} "${apk_directory}/libs/"
|
||||||
|
)
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
|
||||||
# Create "build.xml", "default.properties", "local.properties" and "proguard.cfg" files
|
# Create "build.xml", "default.properties", "local.properties" and "proguard.cfg" files
|
||||||
add_custom_command(TARGET ${ANDROID_NAME}
|
add_custom_command(TARGET ${ANDROID_NAME}
|
||||||
|
|
|
@ -24,10 +24,13 @@ set(ARM_TARGET "armeabi-v7a")
|
||||||
set(TARGET_SHARED_LIBRARIES ${${TARGET_NAME}_LIBRARIES_TO_LINK})
|
set(TARGET_SHARED_LIBRARIES ${${TARGET_NAME}_LIBRARIES_TO_LINK})
|
||||||
list(APPEND TARGET_SHARED_LIBRARIES "${LIBRARY_OUTPUT_PATH}/lib${TARGET_NAME}.so")
|
list(APPEND TARGET_SHARED_LIBRARIES "${LIBRARY_OUTPUT_PATH}/lib${TARGET_NAME}.so")
|
||||||
|
|
||||||
|
set(TARGET_JAR_LIBRARIES "${QT_CMAKE_PREFIX_PATH}/../../jar/QtAndroid-bundled.jar")
|
||||||
|
|
||||||
android_create_apk(
|
android_create_apk(
|
||||||
${TARGET_NAME}
|
${TARGET_NAME}
|
||||||
"${CMAKE_BINARY_DIR}/apk"
|
"${CMAKE_BINARY_DIR}/apk"
|
||||||
"${TARGET_SHARED_LIBRARIES}"
|
"${TARGET_SHARED_LIBRARIES}"
|
||||||
|
"${TARGET_JAR_LIBRARIES}"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/assets"
|
"${CMAKE_CURRENT_SOURCE_DIR}/assets"
|
||||||
"Data"
|
"Data"
|
||||||
)
|
)
|
Loading…
Reference in a new issue