Commit e2ec1b3b authored by Gábor Péterffy's avatar Gábor Péterffy Committed by Mihail Ivchenko
Browse files

Basic plugin install mechanism for Android.

Also link Qt5Sql library (LocalOsmSearchPlugin requires it)
REVIEW: 124457, 124337
parent 6d303c84
......@@ -213,6 +213,9 @@ elseif(APPLE)
#SET (lib_dir ${CMAKE_INSTALL_PREFIX}/Marble.app/Contents/MacOS/lib)
SET (data_dir ${CMAKE_INSTALL_PREFIX}/Marble.app/Contents/MacOS/resources/data)
SET (plugin_dir ${CMAKE_INSTALL_PREFIX}/Marble.app/Contents/MacOS/resources/plugins)
elseif(ANDROID)
set(plugin_dir "${CMAKE_BINARY_DIR}/src/apps/marble_maps/assets/plugins")
set(data_dir "${CMAKE_BINARY_DIR}/src/apps/marble_maps/assets/data")
else() # Linux / bsd etc...
set(data_dir ${CMAKE_INSTALL_PREFIX}/share/marble/data)
set(plugin_dir ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/marble/plugins)
......
......@@ -44,10 +44,7 @@ ENDIF()
add_subdirectory( lib/marble )
add_subdirectory( lib/astro )
#FIXME: Port to Android
if(NOT ANDROID)
add_subdirectory( plugins )
endif()
option(BUILD_MARBLE_APPS "Build Marble Desktop/Mobile applications" ON)
add_feature_info("Marble Desktop/Mobile applications" BUILD_MARBLE_APPS "Build Marble Desktop/Mobile applications. Toggle with BUILD_MARBLE_APPS=YES/NO.")
......
......@@ -13,10 +13,10 @@ target_link_libraries (
${Qt5Network_LIBRARIES}
${Qt5WebKitWidgets_LIBRARIES}
${Qt5WebKit_LIBRARIES}
${Qt5Sql_LIBRARIES}
${MARBLEWIDGET}
astro)
file(COPY "../../../data" DESTINATION "${CMAKE_BINARY_DIR}/src/apps/marble_maps/assets")
file(COPY "../../../data/android/drawable-ldpi" DESTINATION "${CMAKE_BINARY_DIR}/src/apps/marble_maps/res")
file(COPY "../../../data/android/drawable-mdpi" DESTINATION "${CMAKE_BINARY_DIR}/src/apps/marble_maps/res")
file(COPY "../../../data/android/drawable-hdpi" DESTINATION "${CMAKE_BINARY_DIR}/src/apps/marble_maps/res")
......
......@@ -460,6 +460,7 @@ else()
)
endif()
if(NOT ANDROID)
install( FILES
${graphicsview_HDRS}
${marblequick_HDRS}
......@@ -614,6 +615,7 @@ install( FILES
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/marble
)
endif(ANDROID)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config-phonon.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/config-phonon.h)
......@@ -207,6 +207,10 @@ QString MarbleDirs::pluginSystemPath()
if ( !runTimeMarblePluginPath.isEmpty() )
return runTimeMarblePluginPath;
#ifdef ANDROID
return "assets:/plugins";
#endif
#ifdef MARBLE_PLUGIN_PATH
//MARBLE_PLUGIN_PATH is a compiler define set by cmake
QString compileTimeMarblePluginPath(MARBLE_PLUGIN_PATH);
......
......@@ -61,6 +61,10 @@ PluginManagerPrivate::~PluginManagerPrivate()
PluginManager::PluginManager( QObject *parent ) : QObject( parent ),
d( new PluginManagerPrivate() )
{
//Checking assets:/plugins for uninstalled plugins
#ifdef ANDROID
installPluginsFromAssets();
#endif
}
PluginManager::~PluginManager()
......@@ -240,6 +244,25 @@ void PluginManagerPrivate::loadPlugins()
mDebug() << Q_FUNC_INFO << "Time elapsed:" << t.elapsed() << "ms";
}
#ifdef ANDROID
void PluginManager::installPluginsFromAssets() const
{
QStringList copyList = MarbleDirs::pluginEntryList(QString());
QDir pluginHome(MarbleDirs::localPath());
pluginHome.mkpath(MarbleDirs::pluginLocalPath());
pluginHome.setCurrent(MarbleDirs::pluginLocalPath());
foreach (const QString & file, copyList) {
if (QFileInfo(MarbleDirs::pluginSystemPath() + '/' + file).isDir()) {
pluginHome.mkpath(MarbleDirs::pluginLocalPath() + '/' + file);
}
else{
QFile temporaryFile(MarbleDirs::pluginSystemPath() + '/' + file);
temporaryFile.copy(MarbleDirs::pluginLocalPath() + '/' + file);
}
}
}
#endif
}
#include "moc_PluginManager.cpp"
......@@ -151,6 +151,10 @@ Q_SIGNALS:
private:
Q_DISABLE_COPY( PluginManager )
#ifdef ANDROID
void installPluginsFromAssets() const;
#endif
PluginManagerPrivate * const d;
};
......
add_subdirectory( designer )
add_subdirectory( declarative )
add_subdirectory( render )
#FIXME: Port to Android
if(NOT ANDROID)
add_subdirectory( designer )
add_subdirectory( declarative )
add_subdirectory( render )
add_subdirectory( templates )
add_subdirectory( positionprovider )
endif()
add_subdirectory( runner )
add_subdirectory( templates )
add_subdirectory( positionprovider )
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