Commit f16a023b authored by Sandro Andrade's avatar Sandro Andrade
Browse files

Fix some errors when building for Android

Still remaining: to figure out why setting DQTANDROID_EXPORTED_TARGET makes cmake fails
parent 3bf2f5e9
......@@ -43,7 +43,6 @@ find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
find_package(Qt5 CONFIG QUIET OPTIONAL_COMPONENTS QuickCompiler)
IF(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Android")
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
CoreAddons
......@@ -62,8 +61,5 @@ add_subdirectory(src)
add_subdirectory(data)
IF(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Android")
add_subdirectory(doc)
ENDIF(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Android")
IF(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Android")
install(FILES org.kde.minuet.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
ENDIF(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Android")
<?xml version="1.0"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.3.0" package="org.kde.minuet" android:installLocation="auto" android:versionCode="5">
<application android:name="org.qtproject.qt5.android.bindings.QtApplication"
android:label="Minuet"
android:icon="@drawable/minuet"
android:theme="@style/MinuetTheme">
<activity android:name="org.qtproject.qt5.android.bindings.QtActivity"
android:label="Minuet"
android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/>
<meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/>
<meta-data android:name="android.app.repository" android:value="default"/>
<meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
<meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
<!-- Deploy Qt libs as part of package -->
<meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/>
<meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/>
<meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/>
<!-- Run with local libs -->
<meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/>
<meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/>
<meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_LOCAL_LIBS%% --"/>
<meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/>
<meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/>
<!-- Messages maps -->
<meta-data android:name="android.app.ministro_not_found_msg" android:value="@string/ministro_not_found_msg"/>
<meta-data android:name="android.app.ministro_needed_msg" android:value="@string/ministro_needed_msg"/>
<meta-data android:name="android.app.fatal_error_msg" android:value="@string/fatal_error_msg"/>
<!-- Splash screen -->
<meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/splash"/>
</activity>
</application>
<supports-screens android:anyDensity="true" android:normalScreens="true" android:smallScreens="true" android:largeScreens="true"/>
<uses-sdk android:minSdkVersion="17"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<manifest package="org.kde.minuet" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.3.0" android:versionCode="5" android:installLocation="auto">
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="Minuet" android:icon="@drawable/minuet" android:theme="@style/MinuetTheme">
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation"
android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="Minuet" android:screenOrientation="unspecified" android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<meta-data android:name="android.app.lib_name" android:value="minuet"/>
<meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/>
<meta-data android:name="android.app.repository" android:value="default"/>
<meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
<meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
<!-- Deploy Qt libs as part of package -->
<meta-data android:name="android.app.bundle_local_qt_libs" android:value="1"/>
<meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/>
<meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/>
<!-- Run with local libs -->
<meta-data android:name="android.app.use_local_qt_libs" android:value="1"/>
<meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/>
<meta-data android:name="android.app.load_local_libs" android:value="plugins/platforms/android/libqtforandroid.so:plugins/bearer/libqandroidbearer.so:lib/libQt5QuickParticles.so"/>
<meta-data android:name="android.app.load_local_jars" android:value="jar/QtAndroid.jar:jar/QtAndroidBearer.jar"/>
<meta-data android:name="android.app.static_init_classes" android:value=""/>
<!-- Messages maps -->
<meta-data android:name="android.app.ministro_not_found_msg" android:value="@string/ministro_not_found_msg"/>
<meta-data android:name="android.app.ministro_needed_msg" android:value="@string/ministro_needed_msg"/>
<meta-data android:name="android.app.fatal_error_msg" android:value="@string/fatal_error_msg"/>
<!-- Splash screen -->
<meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/splash"/>
<!-- meta-data android:name="android.app.splash_screen_sticky" android:value="true"/ -->
<!-- Splash screen -->
<!-- Background running -->
<!-- Warning: changing this value to true may cause unexpected crashes if the
application still try to draw after
"applicationStateChanged(Qt::ApplicationSuspended)"
signal is sent! -->
<meta-data android:name="android.app.background_running" android:value="false"/>
<!-- Background running -->
<!-- auto screen scale factor -->
<meta-data android:name="android.app.auto_screen_scale_factor" android:value="false"/>
<!-- auto screen scale factor -->
<!-- extract android style -->
<!-- available android:values :
* full - useful for QWidget & Quick Controls 1 apps
* minimal - useful for Quick Controls 2 apps, it is much faster than "full"
* none - useful for apps that don't use any of the above Qt modules
-->
<meta-data android:name="android.app.extract_android_style" android:value="full"/>
<!-- extract android style -->
</activity>
</application>
<uses-sdk android:minSdkVersion="17" android:targetSdkVersion="17"/>
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
Remove the comment if you do not require these default permissions. -->
<!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
Remove the comment if you do not require these default features. -->
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
</manifest>
#!/bin/bash
cmake ../ -DCMAKE_TOOLCHAIN_FILE=/usr/share/ECM/toolchain/Android.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="${Qt5_android}" -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -DQTANDROID_EXPORTED_TARGET=minuet -DANDROID_APK_DIR=../android/
cmake ../ -DCMAKE_TOOLCHAIN_FILE=/usr/share/ECM/toolchain/Android.cmake -DCMAKE_BUILD_TYPE=Release -DECM_ADDITIONAL_FIND_ROOT_PATH=$Qt5_android -DCMAKE_INSTALL_PREFIX=../import -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -DCMAKE_SYSROOT=/data/android-ndk-r10e/platforms/android-17/arch-arm -DCMAKE_ANDROID_API=17
# A diretiva -DQTANDROID_EXPORTED_TARGET esta gerando erro na execucao do cmake: nao encontra o cmake do Qt5Core
#cmake -DCMAKE_TOOLCHAIN_FILE=/usr/share/ECM/toolchain/Android.cmake -DCMAKE_BUILD_TYPE=Release -DECM_ADDITIONAL_FIND_ROOT_PATH="${Qt5_android}" -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -DQTANDROID_EXPORTED_TARGET=minuet -DANDROID_APK_DIR=../android/ -DCMAKE_SYSROOT=/data/android-ndk-r10e/platforms/android-17/arch-arm/ ../
make
......
......@@ -11,4 +11,4 @@ set(minuet_DEFINITIONS
rhythm-definitions.json
)
install(FILES ${minuet_DEFINITIONS} DESTINATION ${KDE_INSTALL_DATADIR}/minuet/definitions)
install(FILES ${minuet_DEFINITIONS} DESTINATION ${CMAKE_INSTALL_PREFIX}/minuet/definitions)
......@@ -13,4 +13,4 @@ set(minuet_EXERCISES
rhythm-medium.json
)
install(FILES ${minuet_EXERCISES} DESTINATION ${KDE_INSTALL_DATADIR}/minuet/exercises)
install(FILES ${minuet_EXERCISES} DESTINATION ${CMAKE_INSTALL_PREFIX}/minuet/exercises)
export BASE_DIR=$HOME
export ANDROID_NDK=$BASE_DIR/android-ndk-r11c
export ANDROID_SDK_ROOT=$BASE_DIR/android-sdk-linux
export Qt5_android=$BASE_DIR/Qt5.7.0/5.7/android_armv7
export PATH=$BASE_DIR/android-sdk-linux/platform-tools/:$PATH
export BASE_DIR=/data
export ANDROID_NDK=$BASE_DIR/android-ndk-r10e
export ANDROID_SDK_ROOT=$BASE_DIR/sdk-tools-linux-4333796
export Qt5_android=$BASE_DIR/Qt/5.11.2/android_armv7
export PATH=$BASE_DIR/sdk-tools-linux-4333796/platform-tools/:$PATH
export ANT=/usr/bin/ant
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk/
export INSTALL_DIR=/home/android-devel/usr/
export INSTALL_DIR=/home/pdv/install-dir/usr
export CMAKE_SYSROOT=$BASE_DIR/android-ndk-r10e/platforms/android-17/arch-arm/
export CSOUND_ANDROID_ROOT=/home/pdv/tmp/csound-android-6.11.0/
export CSOUND_ROOT=/home/pdv/tmp/csound/
......@@ -7,7 +7,7 @@ find_library(CSOUND_SND NAMES libsndfile.so HINTS ${CSOUND_LIBS_DIR} CMAKE_FIND_
set(CSOUND_LIBS ${CSOUND_ANDROID} ${CSOUND_SHARED} ${CSOUND_SND})
include_directories($ENV{CSOUND_ROOT}/include)
include_directories($ENV{CSOUND_ROOT}/android/CsoundAndroid/jni/)
include_directories($ENV{CSOUND_ROOT}/Android/CsoundAndroid/jni/)
set(csoundsoundcontroller_PLUGIN_SRCS
csengine.cpp
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment