diff --git a/cmake/android/AndroidManifest.xml.in b/cmake/android/AndroidManifest.xml.in index 0030ee3e27..cc451e7d1a 100755 --- a/cmake/android/AndroidManifest.xml.in +++ b/cmake/android/AndroidManifest.xml.in @@ -8,7 +8,8 @@ + android:screenOrientation="unspecified" + ${ANDROID_APK_THEME}> diff --git a/cmake/android/QtCreateAPK.cmake b/cmake/android/QtCreateAPK.cmake index 47bb22586b..5fc4a19760 100644 --- a/cmake/android/QtCreateAPK.cmake +++ b/cmake/android/QtCreateAPK.cmake @@ -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) diff --git a/cmake/android/deployment-file.json.in b/cmake/android/deployment-file.json.in index aa4140e36a..b7741ad4ae 100644 --- a/cmake/android/deployment-file.json.in +++ b/cmake/android/deployment-file.json.in @@ -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@" } diff --git a/cmake/macros/LinkSharedDependencies.cmake b/cmake/macros/LinkSharedDependencies.cmake index e25f36fe47..1494b9d109 100644 --- a/cmake/macros/LinkSharedDependencies.cmake +++ b/cmake/macros/LinkSharedDependencies.cmake @@ -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}") diff --git a/cmake/macros/SetupHifiLibrary.cmake b/cmake/macros/SetupHifiLibrary.cmake index 0b81e9bfba..e39b2e69d1 100644 --- a/cmake/macros/SetupHifiLibrary.cmake +++ b/cmake/macros/SetupHifiLibrary.cmake @@ -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) \ No newline at end of file diff --git a/gvr-interface/CMakeLists.txt b/gvr-interface/CMakeLists.txt index 6ab9f914a6..46408657c3 100644 --- a/gvr-interface/CMakeLists.txt +++ b/gvr-interface/CMakeLists.txt @@ -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() \ No newline at end of file