Skip to content

Commit

Permalink
Align naming for components and namespaces
Browse files Browse the repository at this point in the history
* do not choose the camera format

* Align names and use cmake presets

* add the components to the find package config

* engine.loadFromModule in the examples and fix component namings

* Create a single thread for decoding that waits. #81

* use the latest dependencies by tag
  • Loading branch information
EddyTheCo authored Dec 22, 2024
1 parent 1ae452e commit ef5dce9
Show file tree
Hide file tree
Showing 56 changed files with 2,970 additions and 2,641 deletions.
27 changes: 9 additions & 18 deletions .github/workflows/build-test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,15 @@ jobs:
matrix:
os: [ubuntu-latest,macos-latest,windows-latest]

uses: EddyTheCo/Common/.github/workflows/build-test-install.yml@v0.3.0
uses: EddyTheCo/Common/.github/workflows/build-test-install.yml@v0.5.0
with:
os: ${{ matrix.os }}
qtVersion: '6.6.0'
cmakeArgs: "-DQTDEPLOY=ON -DBUILD_EXAMPLES=ON -DCPACK_PACKAGE_CONTACT=estervtech@gmail.com -DREPO_URL=https://eddytheco.github.io/qrCode -DCPACK_PACKAGE_VENDOR=estervtech"
qtVersion: '6.8.1'
qtModules: 'qtshadertools qtmultimedia'
test: false

build_doxygen:
if: startsWith(github.ref, 'refs/tags/v')
uses: EddyTheCo/Common/.github/workflows/build-docs.yml@v0.3.0
with:
cmakeArgs: "-DBUILD_QRDEC=OFF -DBUILD_QRGEN=OFF"

release:
if: startsWith(github.ref, 'refs/tags/v')
needs: [build_test_package, build_doxygen]
needs: build_test_package
runs-on: ubuntu-latest

permissions:
Expand All @@ -48,13 +40,11 @@ jobs:
- uses: actions/download-artifact@v4
with:
path: artifacts
- name: Display structure of downloaded files
run: ls -R

- name: Move repositories to webpage
run: |
mv artifacts/docs/html github-pages
rm -rf artifacts/docs
mv artifacts/common/html github-pages
mv artifacts/common .
mkdir github-pages/packages/ ${{runner.temp}}/platforms/
mv artifacts/*/_CPack_Packages/* ${{runner.temp}}/platforms/
for i in ${{runner.temp}}/platforms/*; do mv $i/IFW/*/repository/* $i/; rm -rf $i/IFW $i/TGZ; done;
Expand All @@ -68,13 +58,14 @@ jobs:
cmake -E tar c ${{runner.temp}}/page-packages/github-pages.tar -- .
- name: Releases
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: ./artifacts/*/*
files: ./artifacts/*/*
body_path: ./common/CHANGELOG.md

- uses: actions/upload-artifact@v4
with:
name: 'github-pages'
name: 'github-pages'
path: ${{runner.temp}}/page-packages/*

- name: Deploy to GitHub Pages
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/code-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: code-format
run-name: Format code and do PR
on:
pull_request_target:
types: [closed]
branches: [develop]
jobs:
checkout-format-pr:
uses: EddyTheCo/Common/.github/workflows/code-format.yml@v0.5.0
if: ${{ (github.event.pull_request.merged == true) && (startsWith(github.base_ref, 'develop')) }}
permissions:
contents: write
pull-requests: write

35 changes: 35 additions & 0 deletions .github/workflows/qml-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: qmllintbot
run-name: Linting QML for PR
on:

workflow_run:
workflows: [push-build-release]
types:
- completed
jobs:
download-comment:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
permissions:
actions: read
pull-requests: write
steps:
- name: 'Download artifact'
uses: actions/download-artifact@v4
with:
name: common
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}

- name: Read pr number
id: getprn
run: |
cat pr_number
echo "prn=$(cat pr_number)" >> $GITHUB_OUTPUT
- name: 'Run reviewer'
uses: EddyTheCo/qmllint-action/@v0.1.0
with:
jsondir: ${{ github.workspace }}
pr_number: ${{ steps.getprn.outputs.prn }}

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
doc/html/
doc/*.tag
*.swp
CMakeLists.txt.user
build*
tags
CMakeUserPresets.json
46 changes: 29 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
cmake_minimum_required(VERSION 3.24)

option(BUILD_QRDEC "Build Decoding part" ON)
option(BUILD_QRENC "Build Encoding part" ON)
option(BUILD_QRGEN "Build Generation part" ON)
option(OpenCV_DOWNLOAD "Download prebuilts if find_package fails" ON)
option(BUILD_EXAMPLES "Build the examples" ON)

include(${CMAKE_CURRENT_BINARY_DIR}/local_conf.cmake OPTIONAL)

include(FetchContent)
FetchContent_Declare(
ccommon
GIT_REPOSITORY https://github.com/EddyTheCo/Common.git
GIT_TAG v0.3.0
)
ccommon
GIT_REPOSITORY https://github.com/EddyTheCo/Common.git
GIT_TAG v0.5.0)
FetchContent_MakeAvailable(ccommon)
version_from_git(
LOG OFF
TIMESTAMP "%Y%m%d%H%M%S"
)
project(qrCode VERSION ${VERSION} DESCRIPTION "library for qr code manipulation" LANGUAGES CXX)
version_from_git(LOG OFF TIMESTAMP "%Y%m%d%H%M%S")
project(
EstervQrCode
VERSION ${VERSION}
DESCRIPTION "Library for qr code manipulation"
LANGUAGES CXX)

set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_CXX_STANDARD 17)
Expand All @@ -24,20 +28,28 @@ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
include(GNUInstallDirs)

if(BUILD_QRDEC)
add_subdirectory(QrDec)
add_subdirectory(QrDec)
endif(BUILD_QRDEC)
if(BUILD_QRENC)
add_subdirectory(QrGen)
endif(BUILD_QRENC)
if(BUILD_QRGEN)
add_subdirectory(QrGen)
endif(BUILD_QRGEN)

add_subdirectory(QtQrDec)
add_subdirectory(QtQrGen)

set(SET_COMPONENTS "")
foreach(component "QrDec" "QrGen" "QtQrDec" "QtQrGen")
if(TARGET "${component}")
string(APPEND SET_COMPONENTS
"set(${PROJECT_NAME}_${component}_FOUND \"ON\")\n")
endif()
endforeach()

build_exports()

if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
build_cpack()
build_cpack()
endif(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
if(BUILD_DOCS)
build_docs()
endif()
build_docs()
endif(BUILD_DOCS)
161 changes: 161 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
{
"version": 6,
"configurePresets": [
{
"name": "default-release",
"displayName": "Default Release",
"description": "Release Static library using Ninja generator",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/release",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"REPO_URL": "https://eddytheco.github.io/Esterv.Utils.QrCode"
}
},
{
"name": "default-develop",
"displayName": "Default Config for development(Release)",
"description": "Release build type using Ninja generator, add tests and docs",
"inherits": "default-release",
"cacheVariables": {
"BUILD_DOCS": "ON",
"BUILD_EXAMPLES": "ON",
"QTDEPLOY": "ON"
}
},
{
"name": "default-develop-debug",
"displayName": "Default Config for development(Debug)",
"description": "Debug build type using Ninja generator",
"inherits": "default-develop",
"binaryDir": "${sourceDir}/build/debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
}
],
"buildPresets": [
{
"name": "default-release",
"configurePreset": "default-release"
},
{
"name": "default-develop",
"configurePreset": "default-develop"
},
{
"name": "default-develop-debug",
"configurePreset": "default-develop-debug"
},
{
"name": "default-documentation",
"configurePreset": "default-develop",
"targets": "doxygen_docs"
},
{
"name": "default-qmllint",
"configurePreset": "default-develop",
"targets": "all_qmllint_json"
}
],
"workflowPresets": [
{
"name": "default-release",
"steps": [
{
"type": "configure",
"name": "default-release"
},
{
"type": "build",
"name": "default-release"
}
]
},
{
"name": "default-develop",
"steps": [
{
"type": "configure",
"name": "default-develop"
},
{
"type": "build",
"name": "default-develop"
}
]
},
{
"name": "default-documentation",
"steps": [
{
"type": "configure",
"name": "default-develop"
},
{
"type": "build",
"name": "default-documentation"
}
]
},
{
"name": "default-qmllint",
"steps": [
{
"type": "configure",
"name": "default-develop"
},
{
"type": "build",
"name": "default-qmllint"
}
]
},
{
"name": "default-develop-debug",
"steps": [
{
"type": "configure",
"name": "default-develop-debug"
},
{
"type": "build",
"name": "default-develop-debug"
}
]
}
],
"packagePresets": [
{
"name": "default-release",
"description": "Release runtime components",
"configurePreset": "default-release",
"generators": [
"IFW",
"TGZ"
],
"variables": {
"CPACK_ARCHIVE_COMPONENT_INSTALL": "ON",
"CPACK_COMPONENTS_ALL": "EstervQrGen;EstervQtQrGen;EstervQrDec;EstervQtQrDec;EstervQtQrGen-qml;EstervQtQrDec-qml",
"CPACK_PACKAGE_CONTACT": "estervtech@gmail.com",
"CPACK_PACKAGE_VENDOR": "estervtech"
},
"packageDirectory": "packages"
},
{
"name": "default-develop",
"description": "Release development components",
"configurePreset": "default-develop",
"generators": [
"IFW",
"TGZ"
],
"variables": {
"CPACK_COMPONENTS_GROUPING": "ALL_COMPONENTS_IN_ONE",
"CPACK_PACKAGE_CONTACT": "estervtech@gmail.com",
"CPACK_PACKAGE_VENDOR": "estervtech"
},
"packageDirectory": "packages-dev"
}
]
}
8 changes: 5 additions & 3 deletions Config.cmake.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@PACKAGE_INIT@
@SET_COMPONENTS@
include(CMakeFindDependencyMacro)
find_dependency(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick Svg OPTIONAL_COMPONENTS Multimedia )
find_dependency(Qt6 COMPONENTS Core Gui Qml Quick Svg OPTIONAL_COMPONENTS Multimedia )
find_dependency(OpenCV COMPONENTS core objdetect imgproc flann features2d calib3d )
find_dependency(EstervDesigns 1.2 COMPONENTS SimpleStyle CustomControls CONFIG)
include ( "${CMAKE_CURRENT_LIST_DIR}/qrCode-config.cmake" )
find_dependency(EstervDesigns 2 COMPONENTS SimpleStyle CustomControls CONFIG)
find_package_handle_standard_args(@PROJECT_NAME@ HANDLE_COMPONENTS)
include ( "${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-config.cmake" )
Loading

0 comments on commit ef5dce9

Please sign in to comment.