Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
redtide authored Jan 4, 2024
0 parents commit 3e90ee9
Show file tree
Hide file tree
Showing 42 changed files with 2,328 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignEscapedNewlines: DontAlign
AlignTrailingComments: true
BreakBeforeBinaryOperators: All
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterFunction: true
BreakConstructorInitializers: BeforeComma
ColumnLimit: 104
FixNamespaceComments: true
IndentWidth: 4
SortIncludes: false

...
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# EditorConfig configuration
# http://editorconfig.org

# Top-most EditorConfig file
root = true

# UTF-8 charset, set indent to spaces with width of four,
# with no trailing whitespaces and a newline ending every file.
[*]
charset = utf-8
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.{html,json,md,yml,sh}]
indent_size = 2
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# See https://help.github.com/en/articles/dealing-with-line-endings

# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

# Denote all files that are truly binary and should not be modified.
*.png binary
*.svgz binary
72 changes: 72 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Build
on:
push:
branches:
- '*'
tags:
- '[0-9]*'
pull_request:
branches:
- '*'
defaults:
run:
shell: bash
env:
build_type: Release
jobs:
linux:
name: Linux
runs-on: ubuntu-latest
strategy:
matrix:
config:
- { name: "GCC", cc: gcc, cxx: g++ }
- { name: "clang", cc: clang, cxx: clang++ }
env:
cc: ${{ matrix.config.cc }}
cxx: ${{ matrix.config.cxx }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Checkout Qtilitools
uses: actions/checkout@v3
with:
repository: qtilities/qtilitools
path: qtilitools

- name: Update Packages
run: sudo apt-get update

- name: Install Dependencies
run: |
packages=(
qtbase5-dev
qttools5-dev
)
sudo apt-get install ${packages[@]}
- name: Build and install Qtilitools
working-directory: ${{ github.workspace }}/qtilitools
run: |
options=(
-D CMAKE_INSTALL_PREFIX="/usr"
-D CMAKE_BUILD_TYPE=${{ env.build_type }}
-B build
)
cmake ${options[@]}
sudo cmake --install build
- name: Configure
run: |
options=(
-D CMAKE_INSTALL_PREFIX="/usr"
-D CMAKE_BUILD_TYPE=${{ env.build_type }}
-B build
)
cmake ${options[@]}
- name: Build
run: cmake --build build --config ${{ env.build_type }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build*/
*.user
compile_commands.json
resources/about.md
11 changes: 11 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Special Thanks to

- Stefonarch (Standreas) and the translation team at <https://translate.lxqt-project.org/>.
- LXQt Developers, for all their software, here using their [build tools].

## Translators

- **Italian**: Andrea Zanellato (author)


[build tools]: https://github.com/lxqt/lxqt-build-tools/
133 changes: 133 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
cmake_minimum_required(VERSION 3.15)
project(Sqeleton
VERSION 0.1.1
LANGUAGES CXX
)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
#===============================================================================
# Qt
#===============================================================================
option(PROJECT_TRANSLATIONS_UPDATE "Update source translations [default: OFF]" OFF)
set(PROJECT_QT_VERSION 5 CACHE STRING "Qt version to use [default: 5]")
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
find_package(QT NAMES Qt${PROJECT_QT_VERSION})
find_package(Qt${QT_VERSION_MAJOR} REQUIRED LinguistTools Widgets)
find_package(Qtilitools REQUIRED)
#===============================================================================
# Project files
#===============================================================================
set(PROJECT_SOURCES
src/application.hpp
src/application.cpp
src/litebutton.hpp
src/litebutton.cpp
src/dialogabout.hpp
src/dialogabout.cpp
src/dialogprefs.hpp
src/dialogprefs.cpp
src/mainwindow.hpp
src/mainwindow.cpp
src/qtilities.hpp
src/settings.hpp
src/settings.cpp
)
set(PROJECT_UI_FILES
src/dialogabout.ui
src/dialogprefs.ui
src/mainwindow.ui
)
set(PROJECT_OTHER_FILES
.github/workflows/build.yml
.clang-format
.editorconfig
.gitattributes
.gitignore
README.md
)
source_group("Other Files" FILES ${PROJECT_OTHER_FILES})
source_group("UI Files" FILES ${PROJECT_UI_FILES})
#===============================================================================
# Resources
#===============================================================================
include(Config.cmake)
include(QtAppResources)
#===============================================================================
# Application executable
#===============================================================================
set(PROJECT_ALL_FILES
${PROJECT_DESKTOP_FILES}
${PROJECT_RESOURCES}
${PROJECT_SOURCES}
${PROJECT_OTHER_FILES}
${PROJECT_QM_FILES}
${PROJECT_TRANSLATION_SOURCES}
${PROJECT_UI_FILES}
)
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
qt_add_executable(${PROJECT_NAME} MANUAL_FINALIZATION ${PROJECT_ALL_FILES})
else()
if(ANDROID)
add_library(${PROJECT_NAME} SHARED ${PROJECT_ALL_FILES})
else()
add_executable(${PROJECT_NAME} ${PROJECT_ALL_FILES})
endif()
endif()

target_link_libraries(${PROJECT_NAME} PRIVATE
Qt::Widgets
)
set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME "${PROJECT_ID}")

target_compile_definitions(${PROJECT_NAME} PRIVATE
APPLICATION_NAME="${PROJECT_NAME}"
ORGANIZATION_NAME="${PROJECT_ORGANIZATION_NAME}"
ORGANIZATION_DOMAIN="${PROJECT_ORGANIZATION_URL}"
PROJECT_ID="${PROJECT_ID}"
PROJECT_DATA_DIR="${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_ID}"
PROJECT_ICON_NAME="${PROJECT_ICON_FILE_NAME}"
PROJECT_ICON_SYSTEM_PATH="${PROJECT_ICON_FILE_PATH}/${PROJECT_ICON_FILE_NAME}"
)
#===============================================================================
# Install application
#===============================================================================
if (UNIX AND NOT APPLE)
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
else()
set_target_properties(${PROJECT_NAME} PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER ${PROJECT_ORGANIZATION_URL}
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
MACOSX_BUNDLE TRUE
WIN32_EXECUTABLE TRUE
)
install(TARGETS ${PROJECT_NAME}
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
endif()
#===============================================================================
# Project information
#===============================================================================
message(STATUS "
Project name: ${PROJECT_NAME}
AppStream ID: ${PROJECT_APPSTREAM_ID}
Version: ${PROJECT_VERSION}
Qt version: ${QT_VERSION}
Build type: ${CMAKE_BUILD_TYPE}
Install prefix: ${CMAKE_INSTALL_PREFIX}
Update translations before build: ${PROJECT_TRANSLATIONS_UPDATE}
CXX Debug flags: ${CMAKE_CXX_FLAGS_DEBUG}
CXX Release flags: ${CMAKE_CXX_FLAGS_RELEASE}
CXX MinSize flags: ${CMAKE_CXX_FLAGS_MINSIZEREL}
CXX RelWithDebInfo flags: ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}
")

if(QT_VERSION_MAJOR EQUAL 6)
qt_finalize_executable(${PROJECT_NAME})
endif()
21 changes: 21 additions & 0 deletions COPYING
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021-2023 Andrea Zanellato <redtid3@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
40 changes: 40 additions & 0 deletions Config.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#===============================================================================
# Editable project configuration
#
# Essential, non translatable application information (except DESCRIPTION).
# Translatable strings are passed via code.
#===============================================================================
string(TOLOWER ${PROJECT_NAME} PROJECT_ID) # Might not be compatible with AppStream
list(APPEND PROJECT_CATEGORIES "Qt;Utility") # Freedesktop menu categories
list(APPEND PROJECT_KEYWORDS "application;project;template")
set(PROJECT_AUTHOR_NAME "Andrea Zanellato")
set(PROJECT_AUTHOR_EMAIL "redtid3@gmail.com") # Used also for organization email
set(PROJECT_COPYRIGHT_YEAR "2021-2023") # TODO: from git
set(PROJECT_DESCRIPTION "Qt application template")
set(PROJECT_ORGANIZATION_NAME "qtilities") # Might be equal to PROJECT_AUTHOR_NAME
set(PROJECT_ORGANIZATION_URL "${PROJECT_ORGANIZATION_NAME}.github.io")
set(PROJECT_HOMEPAGE_URL "https://${PROJECT_ORGANIZATION_URL}/${PROJECT_ID}")
set(PROJECT_REPOSITORY_URL "https://github.com/${PROJECT_ORGANIZATION_NAME}/${PROJECT_ID}")
set(PROJECT_REPOSITORY_BRANCH "master")
set(PROJECT_SPDX_ID "MIT")
set(PROJECT_TRANSLATIONS_DIR "resources/translations")
#===============================================================================
# Appstream
#===============================================================================
set(PROJECT_APPSTREAM_SPDX_ID "CC0-1.0")
include(AppStream)
to_appstream_id("io.github.${PROJECT_ORGANIZATION_NAME}.${PROJECT_NAME}"
PROJECT_APPSTREAM_ID)

set(PROJECT_ICON_FORMAT "svg")
if(UNIX AND NOT APPLE)
set(PROJECT_ICON_FILE_NAME "${PROJECT_APPSTREAM_ID}.${PROJECT_ICON_FORMAT}")
elseif(APPLE)
# TODO: macOS and Windows
else()
endif()
#===============================================================================
# Adapt to CMake variables
#===============================================================================
set(${PROJECT_NAME}_DESCRIPTION "${PROJECT_DESCRIPTION}")
set(${PROJECT_NAME}_HOMEPAGE_URL "${PROJECT_HOMEPAGE_URL}")
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Sqeleton

[![CI]](https://github.com/qtilities/sqeleton/actions/workflows/build.yml)

## Overview

Qt application template repository.

See the related [website page] for further information.

## Features

- Resource management following the Freedesktop [Desktop Entry] Specification
file naming convention (icons, desktop and appdata files)
- [Appstream] metadata information
- Locale translations via [LXQt build tools]
- Install step

## Dependencies

Runtime:

- Qt5/6 base

Build:

- CMake
- Qt Linguist Tools
- Git (optional, to pull latest VCS checkouts)

## Build

`CMAKE_BUILD_TYPE` is usually set to `Release`, though `None` might be a [valid alternative][2].<br>
`CMAKE_INSTALL_PREFIX` has to be set to `/usr` on most operating systems.<br>
Using `sudo make install` is discouraged, instead use the system package manager where possible.

```bash
cmake -B build -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr -W no-dev
cmake --build build --verbose
DESTDIR="$(pwd)/package" cmake --install build
```

## Licenses

- Sqeleton is licensed under the [MIT] license.
- Application icon is from [Openclipart], [CC0-1.0] license.


[Appstream]: https://freedesktop.org/software/appstream/docs/chap-Quickstart.html
[CC0-1.0]: https://creativecommons.org/publicdomain/zero/1.0/
[CI]: https://github.com/qtilities/sqeleton/actions/workflows/build.yml/badge.svg
[Desktop Entry]: https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s02.html
[LXQt build tools]: https://github.com/lxqt/lxqt-build-tools
[MIT]: COPYING
[Openclipart]: https://openclipart.org/
[website page]: https://qtilities.github.io/sqeleton/
7 changes: 7 additions & 0 deletions resources/about.info.md.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# @PROJECT_NAME@ v@PROJECT_VERSION@

@PROJECT_DESCRIPTION@

<@PROJECT_HOMEPAGE_URL@>

__AUTHOR__: @PROJECT_AUTHOR_NAME@
1 change: 1 addition & 0 deletions resources/authors
Loading

0 comments on commit 3e90ee9

Please sign in to comment.