Skip to content

Commit

Permalink
Work on build system
Browse files Browse the repository at this point in the history
  • Loading branch information
emericg committed Mar 28, 2024
1 parent d5112b6 commit f0353a8
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 36 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/builds_desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
uses: jurplel/install-qt-action@v3
with:
version: ${{env.QT_VERSION}}
modules: qt5compat

# Install dependencies (from package manager)
- name: Install dependencies (from package manager)
Expand Down Expand Up @@ -96,7 +95,6 @@ jobs:
uses: jurplel/install-qt-action@v3
with:
version: ${{env.QT_VERSION}}
modules: qt5compat

# Setup env
- name: Setup env
Expand Down Expand Up @@ -143,7 +141,6 @@ jobs:
uses: jurplel/install-qt-action@v3
with:
version: ${{env.QT_VERSION}}
modules: qt5compat

# Install NSIS (already installed in 'windows-2022')
#- name: Install NSIS
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/builds_desktop_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
uses: jurplel/install-qt-action@v3
with:
version: ${{env.QT_VERSION}}
modules: qt5compat

# Install dependencies (from package manager)
- name: Install dependencies (from package manager)
Expand Down Expand Up @@ -97,7 +96,6 @@ jobs:
uses: jurplel/install-qt-action@v3
with:
version: ${{env.QT_VERSION}}
modules: qt5compat

# Setup env
- name: Setup env
Expand Down Expand Up @@ -145,7 +143,6 @@ jobs:
uses: jurplel/install-qt-action@v3
with:
version: ${{env.QT_VERSION}}
modules: qt5compat

# Install NSIS (already installed in 'windows-2022')
#- name: Install NSIS
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/builds_mobile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ jobs:
host: 'linux'
target: 'android'
arch: 'android_arm64_v8a'
modules: qt5compat
extra: '--autodesktop'

# Setup env
Expand Down Expand Up @@ -89,7 +88,6 @@ jobs:
version: ${{env.QT_VERSION}}
host: 'mac'
target: 'ios'
modules: qt5compat qtshadertools
extra: '--autodesktop'

# Setup env
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/builds_mobile_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ jobs:
with:
aqtversion: '==3.1.*'
version: ${{env.QT_VERSION}}
modules: qt5compat

- name: Install Qt (Android armv7)
uses: jurplel/install-qt-action@v3
Expand All @@ -98,7 +97,6 @@ jobs:
host: 'linux'
target: 'android'
arch: 'android_armv7'
modules: qt5compat

- name: Install Qt (Android armv8)
uses: jurplel/install-qt-action@v3
Expand All @@ -108,7 +106,6 @@ jobs:
host: 'linux'
target: 'android'
arch: 'android_arm64_v8a'
modules: qt5compat

- name: Install Qt (Android x86)
uses: jurplel/install-qt-action@v3
Expand All @@ -118,7 +115,6 @@ jobs:
host: 'linux'
target: 'android'
arch: 'android_x86'
modules: qt5compat

- name: Install Qt (Android x86_64)
uses: jurplel/install-qt-action@v3
Expand All @@ -128,7 +124,6 @@ jobs:
host: 'linux'
target: 'android'
arch: 'android_x86_64'
modules: qt5compat

# Install dependencies (from package manager)
- name: Install dependencies (from package manager)
Expand Down Expand Up @@ -201,14 +196,12 @@ jobs:
uses: jurplel/install-qt-action@v3
with:
version: ${{env.QT_VERSION}}
modules: qt5compat qtshadertools

# Install Qt (iOS)
- name: Install Qt (iOS)
uses: jurplel/install-qt-action@v3
with:
version: ${{env.QT_VERSION}}
modules: qt5compat qtshadertools
host: 'mac'
target: 'ios'

Expand Down
6 changes: 2 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(${CMAKE_PROJECT_NAME}
src/SettingsManager.cpp src/SettingsManager.h
src/main.cpp
qml/qml.qrc
qml/components.qrc
i18n/i18n.qrc
assets/assets.qrc
qml/qml.qrc
qml/ComponentLibrary/ComponentLibrary.qrc
)

target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC src/thirdparty/)
Expand Down Expand Up @@ -164,8 +164,6 @@ if(lupdate_only)
target_sources(${CMAKE_PROJECT_NAME} PUBLIC
qml/*.js qml/*.qml
qml/components/*.qml
qml/components_generic/*.qml
qml/components_js/*.js
)
endif()

Expand Down
20 changes: 8 additions & 12 deletions QmlAppTemplate.pro
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ HEADERS += src/SettingsManager.h

INCLUDEPATH += src/ src/thirdparty/

RESOURCES += qml/qml.qrc \
qml/components.qrc \
i18n/i18n.qrc \
assets/assets.qrc
RESOURCES += qml/ComponentLibrary/ComponentLibrary.qrc \
qml/qml.qrc \
assets/assets.qrc \
i18n/i18n.qrc

OTHER_FILES += README.md \
deploy_linux.sh \
Expand Down Expand Up @@ -69,12 +69,8 @@ CONFIG(release, debug|release) : DEFINES += NDEBUG QT_NO_DEBUG QT_NO_DEBUG_OUTPU
# Use Qt Quick compiler
ios | android { CONFIG += qtquickcompiler }

# Math
win32 { DEFINES += _USE_MATH_DEFINES }

# Deprecated Warnings
DEFINES += QT_DEPRECATED_WARNINGS
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

# Enables AddressSanitizer
unix {
Expand All @@ -85,10 +81,10 @@ unix {

# Build artifacts ##############################################################

OBJECTS_DIR = build/$${BUILD_MODE}_$${QT_ARCH}/obj/
MOC_DIR = build/$${BUILD_MODE}_$${QT_ARCH}/moc/
RCC_DIR = build/$${BUILD_MODE}_$${QT_ARCH}/rcc/
UI_DIR = build/$${BUILD_MODE}_$${QT_ARCH}/ui/
OBJECTS_DIR = build/$${QT_ARCH}/$${BUILD_MODE}/obj/
MOC_DIR = build/$${QT_ARCH}/$${BUILD_MODE}/moc/
RCC_DIR = build/$${QT_ARCH}/$${BUILD_MODE}/rcc/
UI_DIR = build/$${QT_ARCH}/$${BUILD_MODE}/ui/

DESTDIR = bin/

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A Qt6 / QML application template, with a full set of visual controls, helper mod

#### Dependencies

You will need a C++17 compiler and Qt 6.5+. Qt 5 Compatibility Module is required.
You will need a C++17 compiler and Qt 6.5+.
For macOS and iOS builds, you'll need Xcode (13+) installed.
For Android builds, you'll need the appropriates JDK (17) SDK (24+) and NDK (25+). You can customize Android build environment using the `assets/android/gradle.properties` file.

Expand Down
1 change: 0 additions & 1 deletion assets/linux/qmlapptemplate.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
<content_rating type="oars-1.1" />

<developer_name>Emeric Grange</developer_name>
<updatecontact>[email protected]</updatecontact>
<url type="homepage">https://emeric.io/</url>
<url type="bugtracker">https://github.com/emericg/QmlAppTemplate/issues</url>
<url type="translate">https://github.com/emericg/QmlAppTemplate/blob/master/i18n/README.md</url>
Expand Down
13 changes: 10 additions & 3 deletions src/thirdparty/AppUtils/AppUtils.pri
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

# Optional stuff (for macOS)
#CONFIG += UTILS_DOCK_ENABLED

# Optional stuff (for iOS)
#CONFIG += UTILS_NOTIFICATIONS_ENABLED
#CONFIG += UTILS_WIFI_ENABLED
Expand Down Expand Up @@ -46,13 +49,17 @@ macx {
HEADERS += $${PWD}/utils_os_macos.h

# macOS dock click handler (optional)
LIBS += -framework AppKit
SOURCES += $${PWD}/utils_os_macos_dock.mm
HEADERS += $${PWD}/utils_os_macos_dock.h
UTILS_DOCK_ENABLED {
DEFINES += UTILS_DOCK_ENABLED
LIBS += -framework AppKit
SOURCES += $${PWD}/utils_os_macos_dock.mm
HEADERS += $${PWD}/utils_os_macos_dock.h
}
}

# Windows OS utils
win32 {
DEFINES += _USE_MATH_DEFINES
SOURCES += $${PWD}/utils_os_windows.cpp
HEADERS += $${PWD}/utils_os_windows.h
}
Expand Down

0 comments on commit f0353a8

Please sign in to comment.