Skip to content

Commit

Permalink
Develop (#13)
Browse files Browse the repository at this point in the history
* use cmake add_library to use build_shared variable (#8)

* adde release action here (#9)

* made qtsvg optional package (#11)

* fixed links (#12)
  • Loading branch information
EddyTheCo authored Jun 14, 2023
1 parent 8d7836b commit 0f58048
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/build-test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,25 @@ jobs:
with:
os: ${{ matrix.os }}
sharedLib: ${{ matrix.sharedLib }}
release:
if: startsWith(github.ref, 'refs/tags/v')
needs: build_test_package
runs-on: ubuntu-latest

permissions:
contents: write

steps:

- uses: actions/checkout@v3

- uses: actions/download-artifact@v3
with:
path: artifacts
- name: Display structure of downloaded files
run: ls -R

- name: Releases
uses: softprops/action-gh-release@v1
with:
files: ./artifacts/*/*
13 changes: 11 additions & 2 deletions QtQrGen/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
project(QrGeneration LANGUAGES CXX)

find_package(Qt6 COMPONENTS Core Gui Qml Quick Svg)
find_package(Qt6 COMPONENTS Core Gui Qml Quick OPTIONAL_COMPONENTS Svg)

if (Qt6_FOUND)
qt_add_library(QtQrGen Qrimageprovider.cpp include/Qrimageprovider.hpp)
add_library(QtQrGen Qrimageprovider.cpp include/Qrimageprovider.hpp)

add_library(qrCode::QtQrGen ALIAS QtQrGen)
target_include_directories(QtQrGen PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/qrCode>")
if(NOT TARGET Qt6::Svg)
FetchContent_Declare(
qtsvg
GIT_REPOSITORY git://code.qt.io/qt/qtsvg.git
GIT_TAG 6.5.0
)
FetchContent_MakeAvailable(qtsvg)
endif()


target_link_libraries(QtQrGen PUBLIC
Expand Down
2 changes: 1 addition & 1 deletion QtQrGen/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# QtQrGen

This code produce a library with a custom ImageProvider of Qt. The image provider print a QRCODE from a string.
You can play with the resulting ImageProvider on [this page](https://eddytheco.github.io/qmlonline/wasm/?example_url=qt_qr_gen).
You can play with the resulting ImageProvider on [this page](https://eddytheco.github.io/qmlonline/?example_url=qt_qr_gen).
An example on how to add the ImageProvider to your project can be found on [this repository](https://github.com/EddyTheCo/qmlonline) (Only the parts enclosed in the USE_QtQrGen macros).

In general CMake produce the target 'QtQrGen' so one can link to this library like
Expand Down

0 comments on commit 0f58048

Please sign in to comment.