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 Nov 28, 2024
1 parent d8a02bd commit e700d8f
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 39 deletions.
34 changes: 13 additions & 21 deletions .github/workflows/builds_desktop_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,23 @@ jobs:
with:
submodules: recursive

# Install Qt
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{env.QT_VERSION}}

# Install dependencies (from package manager)
- name: Install dependencies (from package manager)
run: |
sudo apt-get install libgl1-mesa-dev libxkbcommon-x11-dev libx11-xcb-dev libzstd-dev -y;
sudo apt-get install cmake ninja-build pkgconf libtool -y;
sudo apt-get install appstream -y;
# Setup env
- name: Setup env
run: |
cmake --version
# Install Qt
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{env.QT_VERSION}}

# Build application
- name: Build application
run: |
cmake --version
cmake -B build/ -DCMAKE_BUILD_TYPE=Release -G Ninja
cmake --build build/ --config Release
Expand Down Expand Up @@ -138,28 +134,24 @@ jobs:
with:
arch: x86_64

# Install Qt
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{env.QT_VERSION}}
arch: 'win64_msvc2019_64'

# Install NSIS (already installed in 'windows-2022')
#- name: Install NSIS
# run: |
# Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
# scoop bucket add extras
# scoop install nsis

# Setup env
- name: Setup env
run: |
cmake --version
# Install Qt
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{env.QT_VERSION}}
arch: 'win64_msvc2019_64'

# Build application
- name: Build application
run: |
cmake --version
cmake -B build/ -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles"
cd build/
nmake
Expand Down
25 changes: 9 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ qt_add_qml_module(${CMAKE_PROJECT_NAME}
qml/popups/PopupTime.qml
)

target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE src/)

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

qt_standard_project_setup(
Expand Down Expand Up @@ -134,7 +132,7 @@ target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE thirdparty/)
################################################################################

## Android
if (CMAKE_SYSTEM_NAME STREQUAL "Android")
if(CMAKE_SYSTEM_NAME STREQUAL "Android")
set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES
#QT_ANDROID_ABIS "armeabi-v7a;arm64-v8a;x86;x86_64"
#QT_ANDROID_BUILD_ALL_ABIS ON
Expand All @@ -144,26 +142,21 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Android")
)
endif()

#if (APPLE)
#if(APPLE)
# set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
# set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
# set(CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM "")
# set(CMAKE_XCODE_ATTRIBUTE_PROVISIONING_PROFILE "")
#endif()

## macOS
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
#set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64")
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0")

set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES
MACOSX_BUNDLE ON
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/assets/macos/Info.plist"
# Old way (???)
MACOSX_BUNDLE_GUI_IDENTIFIER "io.emeric.qmlapptemplate"
MACOSX_BUNDLE_BUNDLE_NAME ${CMAKE_PROJECT_NAME}
MACOSX_BUNDLE_BUNDLE_VERSION ${CMAKE_PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
# New Xcode attributes (???)
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "io.emeric.qmlapptemplate"
XCODE_ATTRIBUTE_PRODUCT_NAME ${CMAKE_PROJECT_NAME}
Expand All @@ -174,7 +167,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
endif()

## iOS
if (CMAKE_SYSTEM_NAME STREQUAL "iOS")
if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
#set(assets_catalog_path "${CMAKE_SOURCE_DIR}/assets/ios/Assets.xcassets")
#target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${assets_catalog_path})
#set_source_files_properties(${assets_catalog_path} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
Expand Down Expand Up @@ -204,7 +197,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
endif()

## Release build? Set "no debug" macros
if (CMAKE_BUILD_TYPE STREQUAL Release)
if(CMAKE_BUILD_TYPE STREQUAL Release)
target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE
NDEBUG
QT_NO_DEBUG
Expand All @@ -222,9 +215,9 @@ set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES
)

# Output?
#install(TARGETS ${CMAKE_PROJECT_NAME}
# BUNDLE DESTINATION bin/
# LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
#)
install(TARGETS ${CMAKE_PROJECT_NAME}
BUNDLE DESTINATION "${CMAKE_SOURCE_DIR}/bin"
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)

################################################################################
44 changes: 44 additions & 0 deletions i18n/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Internationalization quick guide
--------------------------------

You can work on translations using one of two ways:
- [Using GitHub](https://github.com/firstcontributions/first-contributions/blob/master/README.md) by forking, branching, translating and creating a pull request.
- Directly, by downloading, translating and emailing the translation files back. It's a way more straightforward workflow, don't bother with GitHub if you don't know how to use it.

##### Step 1: Add the language to the project (if it's a new language)

Edit the Qt project file (_CMakeLists.txt_) and add a new language file entry to the I18N_TRANSLATED_LANGUAGES section.
You'll need to use an [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) two letter code (ex: _i18n/QmlAppTemplate_fr.ts_).

> qt_standard_project_setup(I18N_TRANSLATED_LANGUAGES de fr xx)
##### Step 2: Create / update the language file

To create (or update) the actual translation file, from the project root directory, run the following command:

```
cmake --build build/ --target lupdate
```

This will scrape the source code and add/update the strings that need to be translated into the language files.
If you are not able to run that command, you can simply open a GitHub issue and ask me for a new translation file in the langugage file you want.

##### Step 3: Translating

Translate by editing the .ts file using Qt Linguist.

- Remember to match upper/lower case letters, punctuation and trailing spaces!
- You don't have to translate everything, missing strings will fall back to English.
- If you're not sure about a word or sentence, leave the "unfinished" tag, so other people can have a second look at it.

> Qt Linguist manual: https://doc.qt.io/qt-6/linguist-translators.html
> Qt Linguist standalone downloads: https://github.com/thurask/Qt-Linguist/releases
> Qt Linguist standalone downloads: https://github.com/lelegard/qtlinguist-installers/releases
##### Step 4: Publish it!

Send the file(s) back to the project, using email or a GitHub pull request.
If you want to be credited in the application (and in this file) please be sure to mention it, and provide a name/pseudo, and wished an email/GitHub page.
It's useful in case a person wants to contact you about the translation, or if you want to be contacted when a new version of the project will be released and a translation update is needed.
4 changes: 2 additions & 2 deletions qml/ScreenAbout.qml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Loader {
text: qsTr("SUPPORT")
source: "qrc:/IconLibrary/material-symbols/support.svg"
sourceSize: 22
onClicked: Qt.openUrlExternally("https://emeric.io/")
onClicked: Qt.openUrlExternally("https://github.com/emericg/QmlAppTemplate/issues")
}

ButtonSolid {
Expand Down Expand Up @@ -172,7 +172,7 @@ Loader {
text: qsTr("SUPPORT")
source: "qrc:/IconLibrary/material-symbols/support.svg"
sourceSize: 22
onClicked: Qt.openUrlExternally("https://emeric.io/")
onClicked: Qt.openUrlExternally("https://github.com/emericg/QmlAppTemplate/issues")
}
}

Expand Down

0 comments on commit e700d8f

Please sign in to comment.