Skip to content

Commit

Permalink
Work on CI builds
Browse files Browse the repository at this point in the history
  • Loading branch information
emericg committed Dec 2, 2024
1 parent 74dbf95 commit b19cdd8
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 25 deletions.
23 changes: 13 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,34 @@ message(STATUS "[PROJECT] QT_HOST_PATH = ${QT_HOST_PATH}")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Svg Qml Quick QuickControls2 LabsQmlModels)
find_package(Qt6 REQUIRED COMPONENTS LinguistTools)

qt_standard_project_setup(REQUIRES 6.7)
qt_standard_project_setup(REQUIRES 6.7
I18N_SOURCE_LANGUAGE en
I18N_TRANSLATED_LANGUAGES fr)

qt_policy(SET QTP0001 NEW)
qt_policy(SET QTP0002 NEW)
qt_policy(SET QTP0003 NEW) # Qt 6.7
#qt_policy(SET QTP0004 NEW) # Qt 6.8

# Set app icons
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(app_icon_windows "${CMAKE_SOURCE_DIR}/assets/windows/${CMAKE_PROJECT_NAME}.rc")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(app_icon_macos "${CMAKE_SOURCE_DIR}/assets/macos/${CMAKE_PROJECT_NAME}.icns")
endif()

qt_add_executable(${CMAKE_PROJECT_NAME}
src/main.cpp
src/SettingsManager.cpp src/SettingsManager.h
assets/assets.qrc
thirdparty/IconLibrary/IconLibrary.qrc
${app_icon_macos}
${app_icon_windows}
${app_icon_macos}
)

qt_add_qml_module(${CMAKE_PROJECT_NAME}
URI ${CMAKE_PROJECT_NAME}
NO_PLUGIN
QML_FILES
qml/MobileApplication.qml
qml/MobileHeader.qml
Expand Down Expand Up @@ -85,12 +95,6 @@ qt_add_qml_module(${CMAKE_PROJECT_NAME}
qml/popups/PopupTime.qml
)

################################################################################

qt_standard_project_setup(
I18N_SOURCE_LANGUAGE en
I18N_TRANSLATED_LANGUAGES fr
)
qt_add_translations(${CMAKE_PROJECT_NAME}
TS_FILE_BASE ${CMAKE_PROJECT_NAME}
TS_FILE_DIR ${CMAKE_SOURCE_DIR}/i18n/
Expand Down Expand Up @@ -167,7 +171,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
XCODE_ATTRIBUTE_PRODUCT_NAME ${CMAKE_PROJECT_NAME}
XCODE_ATTRIBUTE_CURRENT_PROJECT_VERSION ${CMAKE_PROJECT_VERSION}
XCODE_ATTRIBUTE_MARKETING_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${CMAKE_SOURCE_DIR}/assets/macos/${CMAKE_PROJECT_NAME}.entitlements"
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${CMAKE_SOURCE_DIR}/assets/macos/${CMAKE_PROJECT_NAME}.entitlements"
)
endif()

Expand Down Expand Up @@ -195,7 +199,6 @@ endif()

## Windows
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")

set(app_icon_windows "${CMAKE_SOURCE_DIR}/assets/windows/${CMAKE_PROJECT_NAME}.rc")

set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES
Expand Down
14 changes: 7 additions & 7 deletions deploy_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ export APP_NAME="QmlAppTemplate"
export APP_VERSION=0.8
export GIT_VERSION=$(git rev-parse --short HEAD)

#export APP_NAME_LOWERCASE=${APP_NAME,,} # lowercase
export APP_NAME_LOWERCASE=$APP_NAME # not actually lowercase

echo "> $APP_NAME packager (Linux x86_64) [v$APP_VERSION]"

## CHECKS ######################################################################
Expand Down Expand Up @@ -114,10 +117,10 @@ if [[ $create_package = true ]] ; then
mkdir -p bin/usr/share/pixmaps/
mkdir -p bin/usr/share/icons/hicolor/scalable/apps/
mv bin/$APP_NAME bin/usr/bin/$APP_NAME
cp assets/linux/$APP_NAME.appdata.xml bin/usr/share/appdata/$APP_NAME.appdata.xml
cp assets/linux/$APP_NAME.desktop bin/usr/share/applications/$APP_NAME.desktop
cp assets/linux/$APP_NAME.svg bin/usr/share/pixmaps/$APP_NAME.svg
cp assets/linux/$APP_NAME.svg bin/usr/share/icons/hicolor/scalable/apps/$APP_NAME.svg
cp assets/linux/$APP_NAME_LOWERCASE.appdata.xml bin/usr/share/appdata/$APP_NAME_LOWERCASE.appdata.xml
cp assets/linux/$APP_NAME_LOWERCASE.desktop bin/usr/share/applications/$APP_NAME_LOWERCASE.desktop
cp assets/linux/$APP_NAME_LOWERCASE.svg bin/usr/share/pixmaps/$APP_NAME_LOWERCASE.svg
cp assets/linux/$APP_NAME_LOWERCASE.svg bin/usr/share/icons/hicolor/scalable/apps/$APP_NAME_LOWERCASE.svg

echo '---- Running AppImage packager'
./contribs/deploy/linuxdeploy-x86_64.AppImage --appdir bin --plugin qt --output appimage
Expand All @@ -130,9 +133,6 @@ fi
## PACKAGE (archive) ###########################################################

if [[ $create_package = true ]] ; then
export APP_NAME_LOWERCASE=${APP_NAME,,}
#export APP_NAME_LOWERCASE=$APP_NAME

echo '---- Reorganize appdir into a regular directory'
mkdir bin/$APP_NAME/
mv bin/usr/bin/* bin/$APP_NAME/
Expand Down
4 changes: 4 additions & 0 deletions deploy_windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ windeployqt bin/ --qmldir qml/
#echo '---- Installation directory content recap (after windeployqt):'
#find bin/

#echo '---- Clean installation directory'
#rm bin/qmltooling
#rm bin/.gitkeep

mv bin $APP_NAME

## PACKAGE (zip) ###############################################################
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/ComponentLibrary/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ set_source_files_properties(ThemeEngine.qml PROPERTIES
QT_QML_SOURCE_TYPENAME Theme
)

qt_add_library(ComponentLibrary STATIC ${MODULE_SOURCES})
qt_add_library(ComponentLibrary STATIC)

qt_add_qml_module(ComponentLibrary
URI ComponentLibrary
Expand Down
15 changes: 8 additions & 7 deletions thirdparty/SingleApplication/SingleApplication.pri
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
QT += core network

android:ios {
# Mobile OS
QT -= widgets
DEFINES -= QAPPLICATION_CLASS
DEFINES += QAPPLICATION_CLASS=QGuiApplication
} else {
# Desktop OS
!defined(QAPPLICATION_CLASS) {
android:ios {
# Mobile OS
DEFINES += QAPPLICATION_CLASS=QGuiApplication
} else {
# Desktop OS
DEFINES += QAPPLICATION_CLASS=QApplication
}
}

eval(QAPPLICATION_CLASS = QApplication) {
Expand Down

0 comments on commit b19cdd8

Please sign in to comment.