mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-22 02:32:29 +01:00
Add explicit arm64-osx support to the build script
Add not yet used download_qt.py
This commit is contained in:
parent
db04e5bab0
commit
a5ca4c7796
@ -7,12 +7,18 @@ project(
|
|||||||
HOMEPAGE_URL "https://screen-play.app/"
|
HOMEPAGE_URL "https://screen-play.app/"
|
||||||
LANGUAGES CXX)
|
LANGUAGES CXX)
|
||||||
|
|
||||||
|
# Only used for some custom file copy
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(VCPKG_ARCH "x64-windows")
|
set(VCPKG_ARCH "x64-windows")
|
||||||
elseif(UNIX AND NOT APPLE)
|
elseif(UNIX AND NOT APPLE)
|
||||||
set(VCPKG_ARCH "x64-linux")
|
set(VCPKG_ARCH "x64-linux")
|
||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
set(VCPKG_ARCH "x64-osx")
|
# CMAKE_HOST_SYSTEM_PROCESSOR returns the value of `uname -p` on host.
|
||||||
|
if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL x86_64 OR CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL amd64)
|
||||||
|
set(VCPKG_ARCH "x64-osx")
|
||||||
|
elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL arm)
|
||||||
|
set(VCPKG_ARCH "arm64-osx")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# This sets cmake to compile all dlls into the main directory
|
# This sets cmake to compile all dlls into the main directory
|
||||||
|
@ -31,11 +31,12 @@ py setup.py
|
|||||||
|
|
||||||
Append this:
|
Append this:
|
||||||
``` bash
|
``` bash
|
||||||
CMAKE_TOOLCHAIN_FILE:STRING=%{CurrentProject:Path}/../ScreenPlay-vcpkg/scripts/buildsystems/vcpkg.cmake
|
-DCMAKE_TOOLCHAIN_FILE:STRING=%{CurrentProject:Path}/../ScreenPlay-vcpkg/scripts/buildsystems/vcpkg.cmake
|
||||||
# Only _one_ of these lines that match your OS:
|
# Only _one_ of these lines that match your OS:
|
||||||
VCPKG_TARGET_TRIPLET:STRING=x64-windows
|
-DVCPKG_TARGET_TRIPLET:STRING=x64-windows
|
||||||
VCPKG_TARGET_TRIPLET:STRING=x64-linux
|
-DVCPKG_TARGET_TRIPLET:STRING=x64-linux
|
||||||
VCPKG_TARGET_TRIPLET:STRING=x64-osx
|
-DVCPKG_TARGET_TRIPLET:STRING=x64-osx
|
||||||
|
-DVCPKG_TARGET_TRIPLET:STRING=arm64-osx
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -50,7 +51,7 @@ VCPKG_TARGET_TRIPLET:STRING=x64-osx
|
|||||||
1. It is recommended (but not necessary) to use an easy git UI like [gitextensions](https://gitextensions.github.io/).
|
1. It is recommended (but not necessary) to use an easy git UI like [gitextensions](https://gitextensions.github.io/).
|
||||||
1. [Download and install the most recent MSVC 2019 Community](https://visualstudio.microsoft.com/vs/community/)
|
1. [Download and install the most recent MSVC 2019 Community](https://visualstudio.microsoft.com/vs/community/)
|
||||||
- Select "Desktop development with C++"
|
- Select "Desktop development with C++"
|
||||||
1. [Download and install Qt 6 binary installer from qt.io](https://www.qt.io/download-qt-installer)
|
1. [Download and install Qt binary installer from qt.io](https://www.qt.io/download-qt-installer)
|
||||||
- Install the Maintaince tool
|
- Install the Maintaince tool
|
||||||
- Select the following features to install:
|
- Select the following features to install:
|
||||||
- Qt 6.3.0
|
- Qt 6.3.0
|
||||||
@ -68,7 +69,7 @@ VCPKG_TARGET_TRIPLET:STRING=x64-osx
|
|||||||
# Debian/Ubuntu
|
# Debian/Ubuntu
|
||||||
sudo apt install build-essential git gpg ffmpeg mesa-common-dev libxkbcommon-* libfontconfig curl zip unzip tar git pkg-config apt-transport-https ca-certificates gnupg software-properties-common wget software-properties-common python3-pip libgl1-mesa-dev lld ninja-build cmake qml-module-qt-websockets qtwebengine5-* -y
|
sudo apt install build-essential git gpg ffmpeg mesa-common-dev libxkbcommon-* libfontconfig curl zip unzip tar git pkg-config apt-transport-https ca-certificates gnupg software-properties-common wget software-properties-common python3-pip libgl1-mesa-dev lld ninja-build cmake qml-module-qt-websockets qtwebengine5-* -y
|
||||||
```
|
```
|
||||||
1. [Download and install Qt 5 binary installer from qt.io](https://www.qt.io/download-qt-installer)
|
1. [Download and install Qt binary installer from qt.io](https://www.qt.io/download-qt-installer)
|
||||||
- Install the Maintaince tool
|
- Install the Maintaince tool
|
||||||
- Select the following features to install:
|
- Select the following features to install:
|
||||||
- Qt 6.3.0
|
- Qt 6.3.0
|
||||||
@ -104,7 +105,9 @@ export PATH="~/.local/bin:$PATH"
|
|||||||
```
|
```
|
||||||
|
|
||||||
## MacOSX
|
## MacOSX
|
||||||
1. [Download and install Qt 5 binary installer from qt.io](https://www.qt.io/download-qt-installer)
|
1. Install [brew](https://brew.sh) that is needed by some third party vcpkg packages. Do not forget to add brew to your path as outlined at the on of the installation!
|
||||||
|
- `brew install pkg-config git llvm cmake ninja`
|
||||||
|
1. [Download and install Qt binary installer from qt.io](https://www.qt.io/download-qt-installer)
|
||||||
- Install the Maintaince tool
|
- Install the Maintaince tool
|
||||||
- Select the following features to install:
|
- Select the following features to install:
|
||||||
- Qt 6.3.0
|
- Qt 6.3.0
|
||||||
@ -118,9 +121,8 @@ export PATH="~/.local/bin:$PATH"
|
|||||||
- OpenSSL 64-bit binaries
|
- OpenSSL 64-bit binaries
|
||||||
- Cmake
|
- Cmake
|
||||||
- Ninja
|
- Ninja
|
||||||
2. Install [homebrew](https://brew.sh/)
|
1. Change your default kit:
|
||||||
- Open a terminal and install clang -> brew install llvm cmake ninja
|
- `QtCreator -> Options -> Kits -> Select your default kit (Desktop Qt 6.3.0) -> Change c and c++ Compiler to Apple Clang (x86_64)`
|
||||||
3. Change your default kit: QtCreator -> Options -> Kits -> Select your default kit (Desktop Qt 6.3.0) -> Change c and c++ Compiler to Apple Clang (x86_64)
|
|
||||||
|
|
||||||
|
|
||||||
# Developer docs
|
# Developer docs
|
||||||
|
@ -43,7 +43,7 @@ set(HEADER
|
|||||||
inc/public/ScreenPlayUtil/AutoPropertyHelpers.h
|
inc/public/ScreenPlayUtil/AutoPropertyHelpers.h
|
||||||
inc/public/ScreenPlayUtil/ConstRefPropertyHelpers.h
|
inc/public/ScreenPlayUtil/ConstRefPropertyHelpers.h
|
||||||
inc/public/ScreenPlayUtil/contenttypes.h
|
inc/public/ScreenPlayUtil/contenttypes.h
|
||||||
inc/public/ScreenPlayUtil/EnumClassHelper.h
|
#inc/public/ScreenPlayUtil/EnumClassHelper.h
|
||||||
inc/public/ScreenPlayUtil/HelpersCommon.h
|
inc/public/ScreenPlayUtil/HelpersCommon.h
|
||||||
inc/public/ScreenPlayUtil/httpfileserver.h
|
inc/public/ScreenPlayUtil/httpfileserver.h
|
||||||
inc/public/ScreenPlayUtil/ListPropertyHelper.h
|
inc/public/ScreenPlayUtil/ListPropertyHelper.h
|
||||||
|
@ -1,40 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <QMetaEnum>
|
|
||||||
#include <QMetaObject>
|
|
||||||
#include <QObject>
|
|
||||||
#include <QQmlEngine>
|
|
||||||
#include <QString>
|
|
||||||
#include <QtQml/QtQml>
|
|
||||||
|
|
||||||
#ifdef Q_ENUM
|
|
||||||
#define QML_EXPORT_ENUM Q_ENUM
|
|
||||||
#else
|
|
||||||
#define QML_EXPORT_ENUM Q_ENUMS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define QML_ENUM_CLASS(NAME, ...) \
|
|
||||||
struct NAME { \
|
|
||||||
Q_GADGET \
|
|
||||||
public: \
|
|
||||||
enum Type { __VA_ARGS__ }; \
|
|
||||||
QML_EXPORT_ENUM(Type) \
|
|
||||||
static QString asString(const int value) \
|
|
||||||
{ \
|
|
||||||
return QString::fromLatin1(staticMetaObject.enumerator(0).valueToKey(value)); \
|
|
||||||
} \
|
|
||||||
static void registerQmlModule(const char* uri, const int majorVersion, const int minorVersion, const char* name) \
|
|
||||||
{ \
|
|
||||||
qmlRegisterUncreatableType<NAME>(uri, majorVersion, minorVersion, name, \
|
|
||||||
QStringLiteral("Enum class, can't be instanciated !")); \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
private: \
|
|
||||||
explicit NAME() { } \
|
|
||||||
NAME(const NAME&); \
|
|
||||||
NAME& operator=(const NAME&); \
|
|
||||||
~NAME(); \
|
|
||||||
}; \
|
|
||||||
Q_DECLARE_METATYPE(NAME::Type)
|
|
||||||
|
|
||||||
QML_ENUM_CLASS(_Test_QmlEnumClass_) // NOTE : to avoid "no suitable class found" MOC note
|
|
@ -2,6 +2,7 @@
|
|||||||
import platform
|
import platform
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import platform
|
||||||
import shutil
|
import shutil
|
||||||
import argparse
|
import argparse
|
||||||
import time
|
import time
|
||||||
@ -58,7 +59,34 @@ def run(cmd, cwd = Path.cwd()):
|
|||||||
raise RuntimeError(f"Failed to execute {cmd}")
|
raise RuntimeError(f"Failed to execute {cmd}")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
root_path = Path.cwd()
|
||||||
|
qt_version = "6.3.0"
|
||||||
|
qt_installer_version = "4.4"
|
||||||
|
qt_path = ""
|
||||||
|
build_steam = "OFF"
|
||||||
|
build_tests = "OFF"
|
||||||
|
build_installer = "OFF"
|
||||||
|
build_release = "OFF"
|
||||||
|
create_installer = "OFF"
|
||||||
|
cmake_target_triplet = ""
|
||||||
|
cmake_build_type = ""
|
||||||
|
executable_file_ending = ""
|
||||||
|
deploy_command = ""
|
||||||
|
aqt_path = ""
|
||||||
|
ifw_root_path = ""
|
||||||
|
aqt_install_qt_packages = ""
|
||||||
|
aqt_install_tool_packages = ""
|
||||||
|
cmake_bin_path = ""
|
||||||
|
file_endings = [".ninja_deps", ".ninja", ".ninja_log", ".lib", ".a", ".exp",
|
||||||
|
".manifest", ".cmake", ".cbp", "CMakeCache.txt"]
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description='Build and Package ScreenPlay')
|
parser = argparse.ArgumentParser(description='Build and Package ScreenPlay')
|
||||||
|
|
||||||
|
parser.add_argument('-qt-version', action="store", dest="qt_version_overwrite",
|
||||||
|
help="Overwrites the default Qt version")
|
||||||
|
parser.add_argument('-qt-installer-version', action="store", dest="qt_installer_version_overwrite",
|
||||||
|
help="Overwrites the default Qt installer framework version")
|
||||||
parser.add_argument('-type', action="store", dest="build_type",
|
parser.add_argument('-type', action="store", dest="build_type",
|
||||||
help="Build type. This is either debug or release.")
|
help="Build type. This is either debug or release.")
|
||||||
parser.add_argument('-use-aqt', action="store_true", dest="use_aqt",
|
parser.add_argument('-use-aqt', action="store_true", dest="use_aqt",
|
||||||
@ -77,27 +105,17 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
if not args.build_type:
|
if not args.build_type:
|
||||||
print("Build type argument is missing (release, debug). E.g: python build.py -type release -steam")
|
print("Build type argument is missing (release, debug). E.g: python build.py -type release -steam")
|
||||||
|
print(f"Defaulting to Qt version: {qt_version}. This can be overwritten via -qt-version 6.5.0")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
root_path = Path.cwd()
|
if args.qt_version_overwrite:
|
||||||
qt_version = "6.3.0"
|
qt_version = args.qt_version_overwrite
|
||||||
qt_path = ""
|
print("Using Qt version {qt_version}")
|
||||||
build_steam = "OFF"
|
|
||||||
build_tests = "OFF"
|
if args.qt_installer_version_overwrite:
|
||||||
build_installer = "OFF"
|
qt_installer_version = args.qt_installer_version_overwrite
|
||||||
build_release = "OFF"
|
print("Using Qt installer framework version {qt_installer_version}")
|
||||||
create_installer = "OFF"
|
|
||||||
cmake_target_triplet = ""
|
|
||||||
cmake_build_type = ""
|
|
||||||
executable_file_ending = ""
|
|
||||||
deploy_command = ""
|
|
||||||
aqt_path = ""
|
|
||||||
ifw_root_path = ""
|
|
||||||
aqt_install_qt_packages = ""
|
|
||||||
aqt_install_tool_packages = ""
|
|
||||||
cmake_bin_path = ""
|
|
||||||
file_endings = [".ninja_deps", ".ninja", ".ninja_log", ".lib", ".a", ".exp",
|
|
||||||
".manifest", ".cmake", ".cbp", "CMakeCache.txt"]
|
|
||||||
|
|
||||||
remove_files_from_build_folder = [
|
remove_files_from_build_folder = [
|
||||||
".ninja_deps",
|
".ninja_deps",
|
||||||
@ -121,7 +139,7 @@ if __name__ == "__main__":
|
|||||||
aqt_path = Path(f"{root_path}/../aqt/").resolve()
|
aqt_path = Path(f"{root_path}/../aqt/").resolve()
|
||||||
|
|
||||||
if not Path(aqt_path).exists():
|
if not Path(aqt_path).exists():
|
||||||
print("aqt path does not exist at %s. Please make sure you have installed aqt." % aqt_path)
|
print(f"aqt path does not exist at {aqt_path}. Please make sure you have installed aqt.")
|
||||||
exit(2)
|
exit(2)
|
||||||
|
|
||||||
if platform.system() == "Windows":
|
if platform.system() == "Windows":
|
||||||
@ -139,7 +157,11 @@ if __name__ == "__main__":
|
|||||||
aqt_install_tool_packages = "windows desktop tools_ifw"
|
aqt_install_tool_packages = "windows desktop tools_ifw"
|
||||||
|
|
||||||
elif platform.system() == "Darwin":
|
elif platform.system() == "Darwin":
|
||||||
cmake_target_triplet = "x64-osx"
|
if(platform.processor() == "arm"):
|
||||||
|
cmake_target_triplet = "arm64-osx"
|
||||||
|
else:
|
||||||
|
cmake_target_triplet = "x64-osx"
|
||||||
|
|
||||||
qt_path = aqt_path.joinpath(f"{qt_version}/macos") if args.use_aqt else Path(f"~/Qt/{qt_version}/macos")
|
qt_path = aqt_path.joinpath(f"{qt_version}/macos") if args.use_aqt else Path(f"~/Qt/{qt_version}/macos")
|
||||||
deploy_command = "{prefix_path}/bin/macdeployqt {app}.app -qmldir=../../{app}/qml -executable={app}.app/Contents/MacOS/{app}"
|
deploy_command = "{prefix_path}/bin/macdeployqt {app}.app -qmldir=../../{app}/qml -executable={app}.app/Contents/MacOS/{app}"
|
||||||
|
|
||||||
@ -182,7 +204,7 @@ if __name__ == "__main__":
|
|||||||
build_tests = "ON"
|
build_tests = "ON"
|
||||||
if args.create_installer:
|
if args.create_installer:
|
||||||
create_installer = "ON"
|
create_installer = "ON"
|
||||||
ifw_root_path = f"{aqt_path}\\Tools\\QtInstallerFramework\\4.2"
|
ifw_root_path = f"{aqt_path}\\Tools\\QtInstallerFramework\\{qt_installer_version}"
|
||||||
|
|
||||||
cmake_configure_command = f'cmake ../ \
|
cmake_configure_command = f'cmake ../ \
|
||||||
-DCMAKE_PREFIX_PATH={qt_path} \
|
-DCMAKE_PREFIX_PATH={qt_path} \
|
||||||
|
47
Tools/download_qt.py
Normal file
47
Tools/download_qt.py
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import subprocess
|
||||||
|
from platform import platform, system
|
||||||
|
from pathlib import Path
|
||||||
|
from execute_util import execute
|
||||||
|
|
||||||
|
|
||||||
|
def run(cmd, cwd=Path.cwd()):
|
||||||
|
result = subprocess.run(cmd, shell=True, cwd=cwd)
|
||||||
|
if result.returncode != 0:
|
||||||
|
raise RuntimeError(f"Failed to execute {cmd}")
|
||||||
|
|
||||||
|
def download_qt():
|
||||||
|
root_path = Path.cwd()
|
||||||
|
qt_version = "6.4.0"
|
||||||
|
qt_installer_version = "4.4"
|
||||||
|
qt_path = " "
|
||||||
|
operating_system = " "
|
||||||
|
device_type = "desktop"
|
||||||
|
qt_bin = " "
|
||||||
|
aqt_path = Path(f"{root_path}/../../aqt/").resolve()
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser(description='Installs qt')
|
||||||
|
parser.add_argument('--path', help='')
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
if system() == "Windows":
|
||||||
|
operating_system = "windows"
|
||||||
|
qt_bin = "win64_msvc2019_64"
|
||||||
|
elif system() == "Darwin":
|
||||||
|
operating_system = "mac"
|
||||||
|
qt_bin = "clang_64"
|
||||||
|
elif system() == "Linux":
|
||||||
|
operating_system = "linux"
|
||||||
|
qt_bin = "gcc_64"
|
||||||
|
|
||||||
|
print(f"Download destination: {aqt_path} ")
|
||||||
|
run("python3 -m pip install -U pip wheel")
|
||||||
|
run("python3 -m pip install aqtinstall")
|
||||||
|
run(f"python3 -m aqt install-qt -O {aqt_path} {operating_system} {device_type} {qt_version} {qt_bin} -m all")
|
||||||
|
run(f"python3 -m aqt install-tool -O {aqt_path} {operating_system} {device_type} tools_ifw ")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
download_qt()
|
Loading…
Reference in New Issue
Block a user