repairs to deployment json file creation

This commit is contained in:
Stephen Birarda 2014-11-18 10:10:12 -08:00
parent 225e326420
commit fe0d9cc034
6 changed files with 25 additions and 25 deletions

View file

@ -8,7 +8,8 @@
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation"
android:name="org.qtproject.qt5.android.bindings.QtActivity"
android:label="@string/app_name"
android:screenOrientation="unspecified">
android:screenOrientation="unspecified"
${ANDROID_APK_THEME}>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>

View file

@ -13,11 +13,12 @@
# These options will modify how QtCreateAPK behaves. May be useful if somebody wants to fork.
# For High Fidelity purposes these should not need to be changed.
#
set(ANDROID_APK_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/apk")
set(ANDROID_THIS_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) # Directory this CMake file is in
if (POLICY CMP0026)
cmake_policy(SET CMP0026 OLD)
endif ()
macro(qt_create_apk)
if(ANDROID_APK_FULLSCREEN)
set(ANDROID_APK_THEME "android:theme=\"@android:style/Theme.NoTitleBar.Fullscreen\"")
@ -34,13 +35,13 @@ macro(qt_create_apk)
endif ()
# Create "AndroidManifest.xml"
configure_file("${ANDROID_THIS_DIRECTORY}/AndroidManifest.xml.in" "${ANDROID_APK_DIRECTORY}/AndroidManifest.xml")
configure_file("${ANDROID_THIS_DIRECTORY}/AndroidManifest.xml.in" "${ANDROID_APK_DIR}/AndroidManifest.xml")
# Create "res/values/strings.xml"
configure_file("${ANDROID_THIS_DIRECTORY}/strings.xml.in" "${ANDROID_APK_DIRECTORY}/res/values/strings.xml")
configure_file("${ANDROID_THIS_DIRECTORY}/strings.xml.in" "${ANDROID_APK_DIR}/res/values/strings.xml")
# figure out where the qt dir is
get_filename_component(_QT_DIR "${QT_CMAKE_PREFIX_PATH}/../../../" ABSOLUTE)
get_filename_component(QT_DIR "${QT_CMAKE_PREFIX_PATH}/../../../" ABSOLUTE)
# find androiddeployqt
find_program(ANDROID_DEPLOY_QT androiddeployqt HINTS "${_QT_DIR}/bin")
@ -50,15 +51,18 @@ macro(qt_create_apk)
# add our dependencies to the deployment file
get_property(_DEPENDENCIES TARGET ${TARGET_NAME} PROPERTY INTERFACE_LINK_LIBRARIES)
set(_DEPS_LIST)
message(${_DEPENDENCIES})
foreach(_DEP IN LISTS _DEPENDENCIES)
if (NOT TARGET ${_DEP})
list(APPEND _DEPS_LIST ${_DEP})
else ()
if(NOT _DEP MATCHES "Qt5::.*")
get_property(_DEP_LOCATION TARGET ${_DEP} PROPERTY "LOCATION_${CMAKE_BUILD_TYPE}")
list(APPEND _DEPS_LIST ${_DEP_LOCATION})
get_property(_DEP_LOCATION TARGET ${_DEP} PROPERTY "LOCATION_${CMAKE_BUILD_TYPE}")
list(APPEND _DEPS_LIST ${_DEP_LOCATION})
endif()
endif ()
endforeach()
string(REPLACE ";" "," _DEPS "${_DEPS_LIST}")
configure_file("${ANDROID_THIS_DIRECTORY}/deployment-file.json.in" "${TARGET_NAME}-deployment.json")
# Uninstall previous version from the device/emulator (else we may get e.g. signature conflicts)

View file

@ -1,14 +1,14 @@
{
"qt": "@QTDIR@",
"qt": "@QT_DIR@",
"sdk": "@ANDROID_SDK_ROOT@",
"ndk": "@ANDROID_NDK@",
"toolchain-prefix": "@ANDROID_TOOLCHAIN@",
"tool-prefix": "@ANDROID_TOOLCHAIN@",
"toolchain-version": "@ANDROID_GCC_VERSION@",
"ndk-host": "@_HOST@",
"toolchain-prefix": "@$ANDROID_TOOLCHAIN_MACHINE_NAME@",
"tool-prefix": "@ANDROID_TOOLCHAIN_MACHINE_NAME@",
"toolchain-version": "@ANDROID_COMPILER_VERSION@",
"ndk-host": "@ANDROID_NDK_HOST_SYSTEM_NAME@",
"target-architecture": "@ANDROID_ABI@",
"application-binary": "@EXECUTABLE_DESTINATION_PATH@",
"android-extra-libs": "@_DEPS@",
"android-extra-plugins": "@CMAKE_PREFIX_PATH@/share,@CMAKE_PREFIX_PATH@/lib/qml",
"android-extra-plugins": "",
"android-package-source-directory": "@ANDROID_APK_DIR@"
}

View file

@ -23,12 +23,6 @@ macro(LINK_SHARED_DEPENDENCIES)
# include those in our own target
include_directories(SYSTEM ${${TARGET_NAME}_DEPENDENCY_INCLUDES})
endif ()
if (${TARGET_NAME}_QT_MODULES_TO_LINK)
# we've already linked our Qt modules, but we need to bubble them up to parents
list(REMOVE_DUPLICATES ${TARGET_NAME}_QT_MODULES_TO_LINK)
list(APPEND ${TARGET_NAME}_LIBRARIES_TO_LINK "${${TARGET_NAME}_QT_MODULES_TO_LINK}")
endif ()
# set the property on this target so it can be retreived by targets linking to us
set_target_properties(${TARGET_NAME} PROPERTIES DEPENDENCY_LIBRARIES "${${TARGET_NAME}_LIBRARIES_TO_LINK}")

View file

@ -32,6 +32,5 @@ macro(SETUP_HIFI_LIBRARY)
# add the actual path to the Qt module to our LIBRARIES_TO_LINK variable
target_link_libraries(${TARGET_NAME} Qt5::${QT_MODULE})
list(APPEND ${TARGET_NAME}_QT_MODULES_TO_LINK ${QT_LIBRARY_LOCATION})
endforeach()
endmacro(SETUP_HIFI_LIBRARY)

View file

@ -10,9 +10,11 @@ set(REQUIRED_HIFI_LIBRARIES "shared" "networking")
link_hifi_libraries(${REQUIRED_HIFI_LIBRARIES})
link_shared_dependencies()
set(ANDROID_SDK_ROOT $ENV{ANDROID_SDK})
set(ANDROID_APP_NAME Interface)
set(ANDROID_API_LEVEL 19)
set(ANDROID_APK_PACKAGE io.highfidelity.io)
set(ANDROID_APK_PACKAGE io.highfidelity.gvrinterface)
set(ANDROID_APK_FULLSCREEN true)
set(ANDROID_APK_DIR "${CMAKE_CURRENT_BINARY_DIR}/apk")
qt_create_apk()