From a8811792d30dd09ea7642946bb5f59b4a6ae9520 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Mon, 23 Sep 2019 14:52:44 +0200 Subject: [PATCH] Deploy sceneparsers, geometryloaders and gamepads as well --- src/main.cpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 8e52d6d..29fb4ad 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -260,6 +260,33 @@ bool deployWebEnginePlugins(appdir::AppDir &appDir, const bf::path &qtLibexecsPa return true; } +bool deploy3DPlugins(appdir::AppDir &appDir, const bf::path &qtPluginsPath) { + ldLog() << "Deploying Qt 3D plugins" << std::endl; + + for (bf::directory_iterator i(qtPluginsPath / "geometryloaders"); i != bf::directory_iterator(); ++i) { + if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/geometryloaders/")) + return false; + } + + for (bf::directory_iterator i(qtPluginsPath / "sceneparsers"); i != bf::directory_iterator(); ++i) { + if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/sceneparsers/")) + return false; + } + + return true; +} + +bool deployGamepadPlugins(appdir::AppDir &appDir, const bf::path &qtPluginsPath) { + ldLog() << "Deploying Gamepad plugins" << std::endl; + + for (bf::directory_iterator i(qtPluginsPath / "gamepads"); i != bf::directory_iterator(); ++i) { + if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/gamepads/")) + return false; + } + + return true; +} + bool createQtConf(appdir::AppDir &appDir) { auto qtConfPath = appDir.path() / "usr" / "bin" / "qt.conf"; @@ -621,6 +648,16 @@ int main(const int argc, const char *const *const argv) { if (!deployQmlFiles(appDir, qtInstallQmlPath)) return 1; } + + if (module.name == "3dquickrender") { + if (!deploy3DPlugins(appDir, qtPluginsPath)) + return 1; + } + + if (module.name == "gamepad") { + if (!deployGamepadPlugins(appDir, qtPluginsPath)) + return 1; + } } ldLog() << std::endl << "-- Deploying translations --" << std::endl;