From 376e96f96cbccc5784f7502aad2da9c3e72308ed Mon Sep 17 00:00:00 2001 From: Elias Steurer Date: Fri, 15 Jul 2022 13:05:47 +0200 Subject: [PATCH] Add macos folder copy for qml folder --- ScreenPlayWallpaper/src/macwindow.cpp | 3 ++- Tools/build.py | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ScreenPlayWallpaper/src/macwindow.cpp b/ScreenPlayWallpaper/src/macwindow.cpp index 2d62f5cd..d918e5cc 100644 --- a/ScreenPlayWallpaper/src/macwindow.cpp +++ b/ScreenPlayWallpaper/src/macwindow.cpp @@ -46,7 +46,8 @@ MacWindow::MacWindow( workingDir.cdUp(); workingDir.cdUp(); // OSX Development workaround: - // + // This folder needs then to be copied into the .app/Contents/MacOS/ + // for the deploy version. m_window.engine()->addImportPath(workingDir.path()+"/qml"); #endif diff --git a/Tools/build.py b/Tools/build.py index e47590a7..2e95db47 100755 --- a/Tools/build.py +++ b/Tools/build.py @@ -7,6 +7,7 @@ import shutil import argparse import time import zipfile +from shutil import copytree from pathlib import Path from concurrent.futures import ThreadPoolExecutor from datetime import datetime @@ -289,6 +290,12 @@ def build( run("spctl --assess --verbose \"ScreenPlayWallpaper.app/\"", cwd=bin_dir) run("spctl --assess --verbose \"ScreenPlayWidget.app/\"", cwd=bin_dir) + # Copy qml dir into all .app/Contents/MacOS/ + if platform.system() == "Darwin": + copytree(Path.joinpath(bin_dir, "qml"), Path.joinpath(bin_dir, "ScreenPlay.app/Contents/MacOS/qml")) + copytree(Path.joinpath(bin_dir, "qml"), Path.joinpath(bin_dir, "ScreenPlayWallpaper.app/Contents/MacOS/qml")) + copytree(Path.joinpath(bin_dir, "qml"), Path.joinpath(bin_dir, "ScreenPlayWidget.app/Contents/MacOS/qml")) + # Some dlls like openssl do no longer get copied automatically. # Lets just copy all of them into bin. if platform.system() == "Windows":