Skip to content

Commit

Permalink
use ifw
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyTheCo committed Mar 25, 2024
1 parent 293c3b3 commit 8b17332
Show file tree
Hide file tree
Showing 12 changed files with 235 additions and 181 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/build-docs.yml

This file was deleted.

50 changes: 44 additions & 6 deletions .github/workflows/build-test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: push-build-release
run-name: ${{ github.actor }} ${{ github.event_name }} to ${{ github.base_ref }}
on:

test: false
push:
tags:
- 'v*'
Expand All @@ -13,21 +14,30 @@ jobs:
matrix:
os: [ubuntu-latest,macos-latest,windows-latest]

uses: EddyTheCo/Common/.github/workflows/build-test-install.yml@develop
permissions:
contents: write
uses: EddyTheCo/Common/.github/workflows/build-test-install.yml@use_IFW
with:
os: ${{ matrix.os }}
qtVersion: '6.6.0'
cmakeArgs: "-DCPACK_PACKAGE_CONTACT=estervtech@gmail.com -DREPO_URL=https://eddytheco.github.io/qrCode -DCPACK_PACKAGE_VENDOR=estervtech"
qtModules: 'qtshadertools qtmultimedia'
test: false

build_doxygen:
if: startsWith(github.ref, 'refs/tags/v')
uses: EddyTheCo/Common/.github/workflows/build-docs.yml@use_IFW

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

permissions:
contents: write
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:

Expand All @@ -36,7 +46,35 @@ 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
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;
mv ${{runner.temp}}/platforms/* github-pages/packages/
rm -rf artifacts/*/_CPack_Packages
- name: Package github-page
working-directory: ${{ github.workspace }}/github-pages/
run: |
cmake -E make_directory ${{runner.temp}}/page-packages
cmake -E tar c ${{runner.temp}}/page-packages/github-pages.tar -- .
- name: Releases
uses: softprops/action-gh-release@v1
with:
files: ./artifacts/*/*
files: ./artifacts/*/*

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

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
24 changes: 14 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include(FetchContent)
FetchContent_Declare(
ccommon
GIT_REPOSITORY https://github.com/EddyTheCo/Common.git
GIT_TAG develop
GIT_TAG use_IFW
)
FetchContent_MakeAvailable(ccommon)
version_from_git(
Expand Down Expand Up @@ -53,20 +53,24 @@ install(FILES
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
COMPONENT ${PROJECT_NAME}
)
export(EXPORT ${PROJECT_NAME}-config
FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake"
)

if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
set(CPACK_PACKAGE_CONTACT "estervtech")
include(CTest)
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-v${SEMVER}-${CMAKE_SYSTEM_NAME}_${CMAKE_SYSTEM_VERSION}-${CMAKE_SYSTEM_PROCESSOR}-${CMAKE_CXX_COMPILER_ID}")
if(NOT BUILD_SHARED_LIBS)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-static")
endif(NOT BUILD_SHARED_LIBS)
include(CPack)
endif()
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
set(cpack_file_name "${PROJECT_NAME}-v${SEMVER}-${CMAKE_SYSTEM_NAME}_${CMAKE_SYSTEM_VERSION}-${CMAKE_SYSTEM_PROCESSOR}-${CMAKE_CXX_COMPILER_ID}")
if(NOT BUILD_SHARED_LIBS)
set(cpack_file_name "${cpack_file_name}-static")
endif(NOT BUILD_SHARED_LIBS)
set(CPACK_PACKAGE_FILE_NAME ${cpack_file_name})
include(CPack)
include(CPackIFW)
cpack_add_component(${PROJECT_NAME})
cpack_ifw_configure_component(${PROJECT_NAME} LICENSES "License" ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE)
cpack_ifw_add_repository("Repo" URL "${REPO_URL}/packages/${CMAKE_SYSTEM_NAME}/" )
endif(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
if(BUILD_DOCS)
build_docs()
endif()
5 changes: 3 additions & 2 deletions QrDec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,19 @@ if(OpenCV_FOUND)
add_library(QrDec qrcodedec.cpp)

add_library(${PROJECT_NAME}::QrDec ALIAS QrDec)
set_target_properties(QrDec PROPERTIES VERSION ${VERSION} SOVERSION ${VERSION_MAJOR})
target_include_directories(QrDec PUBLIC $<BUILD_INTERFACE:${OpenCV_INCLUDE_DIRS}>)
target_link_libraries(QrDec PUBLIC ${OpenCV_LIBS})

target_include_directories(QrDec PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/Esterv/${PROJECT_NAME}>")
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/Esterv/>")
install(TARGETS QrDec
EXPORT ${PROJECT_NAME}-config
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT QrDec
)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Esterv/${PROJECT_NAME}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Esterv
COMPONENT QrDec
)
else()
Expand Down
4 changes: 2 additions & 2 deletions QrDec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ include(FetchContent)
FetchContent_Declare(
qrCode
GIT_REPOSITORY https://github.com/EddyTheCo/qrCode.git
GIT_TAG v1.0.0
FIND_PACKAGE_ARGS 1.0 COMPONENTS QrDec CONFIG
GIT_TAG vMAJOR.MINOR.PATCH
FIND_PACKAGE_ARGS MAJOR.MINOR COMPONENTS QrDec CONFIG
)
FetchContent_MakeAvailable(qrCode)
Expand Down
5 changes: 3 additions & 2 deletions QrGen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ add_library(${PROJECT_NAME}::QrGen ALIAS QrGen)

set_target_properties(QrGen PROPERTIES POSITION_INDEPENDENT_CODE ON)

set_target_properties(QrGen PROPERTIES VERSION ${VERSION} SOVERSION ${VERSION_MAJOR})

target_include_directories(QrGen PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/Esterv/${PROJECT_NAME}>")
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/Esterv/>")

install(TARGETS QrGen
EXPORT ${PROJECT_NAME}-config
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT QrGen
)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Esterv/${PROJECT_NAME}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Esterv
COMPONENT QrGen
)

4 changes: 2 additions & 2 deletions QrGen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ include(FetchContent)
FetchContent_Declare(
qrCode
GIT_REPOSITORY https://github.com/EddyTheCo/qrCode.git
GIT_TAG v1.0.0
FIND_PACKAGE_ARGS 1.0 COMPONENTS QrGen CONFIG
GIT_TAG vMAJOR.MINOR.PATCH
FIND_PACKAGE_ARGS MAJOR.MINOR COMPONENTS QrGen CONFIG
)
FetchContent_MakeAvailable(qrCode)
Expand Down
145 changes: 73 additions & 72 deletions QtQrDec/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,89 +1,90 @@

if(EMSCRIPTEN)
find_package(Qt6 COMPONENTS Core Gui Qml Quick ShaderTools)
find_package(Qt6 COMPONENTS Core Gui Qml Quick ShaderTools)
else()
find_package(Qt6 COMPONENTS Core Gui Qml Quick ShaderTools Multimedia)
find_package(Qt6 COMPONENTS Core Gui Qml Quick ShaderTools Multimedia)
endif(EMSCRIPTEN)

FetchContent_Declare(
EstervDesigns
GIT_REPOSITORY https://github.com/EddyTheCo/MyDesigns.git
GIT_TAG develop
FIND_PACKAGE_ARGS 1.1 COMPONENTS SimpleStyle CustomControls CONFIG
)
EstervDesigns
GIT_REPOSITORY https://github.com/EddyTheCo/MyDesigns.git
GIT_TAG develop
FIND_PACKAGE_ARGS 1.1 COMPONENTS SimpleStyle CustomControls CONFIG
)
FetchContent_MakeAvailable(EstervDesigns)


if (Qt6_FOUND AND TARGET QrDec)
qt_standard_project_setup()
qt6_add_qml_module(QtQrDec
URI Esterv.CustomControls.QrDec
VERSION 1.0
SOURCES Qrimagedecoder.cpp include/Qrimagedecoder.hpp
QML_FILES
"qml/QrCam.qml"
"qml/QrDecPop.qml"
"qml/QrTextField.qml"
RESOURCE_PREFIX
"/esterVtech.com/imports"
OUTPUT_TARGETS out_targets_var
OUTPUT_DIRECTORY
${CMAKE_BINARY_DIR}/Esterv/CustomControls/QrDec
IMPORT_PATH ${CMAKE_BINARY_DIR} ${CMAKE_INSTALL_LIBDIR}
)
qt_standard_project_setup()
qt6_add_qml_module(QtQrDec
URI Esterv.CustomControls.QrDec
VERSION 1.0
SOURCES Qrimagedecoder.cpp include/Qrimagedecoder.hpp
QML_FILES
"qml/QrCam.qml"
"qml/QrDecPop.qml"
"qml/QrTextField.qml"
RESOURCE_PREFIX
"/esterVtech.com/imports"
OUTPUT_TARGETS out_targets_var
OUTPUT_DIRECTORY
${CMAKE_BINARY_DIR}/Esterv/CustomControls/QrDec
IMPORT_PATH ${CMAKE_BINARY_DIR} ${CMAKE_INSTALL_LIBDIR}
)

add_library(${PROJECT_NAME}::QtQrDec ALIAS QtQrDec)
add_library(${PROJECT_NAME}::QtQrDecplugin ALIAS QtQrDecplugin)
target_compile_definitions(QtQrDec PRIVATE WINDOWS_DEC)
add_library(${PROJECT_NAME}::QtQrDec ALIAS QtQrDec)
add_library(${PROJECT_NAME}::QtQrDecplugin ALIAS QtQrDecplugin)
target_compile_definitions(QtQrDec PRIVATE WINDOWS_DEC)
set_target_properties(QtQrDec PROPERTIES VERSION ${VERSION} SOVERSION ${VERSION_MAJOR})

qt6_add_shaders(QtQrDec "esterVtech.com.imports.QtQrDec.shaders"
BATCHABLE
PRECOMPILE
OPTIMIZED
OUTPUT_TARGETS out_targets_var2
PREFIX
"/esterVtech.com/imports/Designs"
FILES
"frag/qrscanner.frag"
)
target_include_directories(QtQrDec PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/Esterv/${PROJECT_NAME}>")
if(EMSCRIPTEN)
target_compile_definitions(QtQrDec PRIVATE USE_EMSCRIPTEN)
else()
target_link_libraries(QtQrDec PUBLIC Qt6::Multimedia)
endif(EMSCRIPTEN)
target_link_libraries(QtQrDec PUBLIC Qt6::Gui Qt6::Quick QrDec
EstervDesigns::SimpleStyle EstervDesigns::CustomControls
$<$<STREQUAL:$<TARGET_PROPERTY:EstervDesigns::SimpleStyle,TYPE>,STATIC_LIBRARY>:EstervDesigns::SimpleStyleplugin>
$<$<STREQUAL:$<TARGET_PROPERTY:EstervDesigns::CustomControls,TYPE>,STATIC_LIBRARY>:EstervDesigns::CustomControlsplugin>)
qt6_add_shaders(QtQrDec "esterVtech.com.imports.QtQrDec.shaders"
BATCHABLE
PRECOMPILE
OPTIMIZED
OUTPUT_TARGETS out_targets_var2
PREFIX
"/esterVtech.com/imports/Designs"
FILES
"frag/qrscanner.frag"
)
target_include_directories(QtQrDec PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/Esterv/>")
if(EMSCRIPTEN)
target_compile_definitions(QtQrDec PRIVATE USE_EMSCRIPTEN)
else()
target_link_libraries(QtQrDec PUBLIC Qt6::Multimedia)
endif(EMSCRIPTEN)
target_link_libraries(QtQrDec PUBLIC Qt6::Gui Qt6::Quick QrDec
EstervDesigns::SimpleStyle EstervDesigns::CustomControls
$<$<STREQUAL:$<TARGET_PROPERTY:EstervDesigns::SimpleStyle,TYPE>,STATIC_LIBRARY>:EstervDesigns::SimpleStyleplugin>
$<$<STREQUAL:$<TARGET_PROPERTY:EstervDesigns::CustomControls,TYPE>,STATIC_LIBRARY>:EstervDesigns::CustomControlsplugin>)

install(TARGETS QtQrDec ${out_targets_var} ${out_targets_var2}
EXPORT ${PROJECT_NAME}-config
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT QtQrDec
)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Esterv/${PROJECT_NAME}
COMPONENT QtQrDec
)
install(DIRECTORY ${CMAKE_BINARY_DIR}/Esterv/CustomControls/QrDec
DESTINATION ${CMAKE_INSTALL_LIBDIR}/Esterv/CustomControls
COMPONENT QtQrDec
)
install(TARGETS QtQrDec ${out_targets_var} ${out_targets_var2}
EXPORT ${PROJECT_NAME}-config
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT QtQrDec
)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Esterv
COMPONENT QtQrDec
)
install(DIRECTORY ${CMAKE_BINARY_DIR}/Esterv/CustomControls/QrDec
DESTINATION ${CMAKE_INSTALL_LIBDIR}/Esterv/CustomControls
COMPONENT QtQrDec
)

install(TARGETS QtQrDecplugin
EXPORT ${PROJECT_NAME}-config
DESTINATION ${CMAKE_INSTALL_LIBDIR}/Esterv/CustomControls/QrDec
COMPONENT QtQrDec
)
install(TARGETS QtQrDecplugin
EXPORT ${PROJECT_NAME}-config
DESTINATION ${CMAKE_INSTALL_LIBDIR}/Esterv/CustomControls/QrDec
COMPONENT QtQrDec
)

if(EMSCRIPTEN)
target_compile_definitions(QtQrDec PRIVATE USE_EMSCRIPTEN)
endif(EMSCRIPTEN)
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
add_subdirectory(examples)
endif(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
if(EMSCRIPTEN)
target_compile_definitions(QtQrDec PRIVATE USE_EMSCRIPTEN)
endif(EMSCRIPTEN)
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
add_subdirectory(examples)
endif(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
else(Qt6_FOUND AND TARGET QrDec)
message(STATUS "The QML Module for QRCODE decoding will not be built")
message(STATUS "The QML Module for QRCODE decoding will not be built")
endif(Qt6_FOUND AND TARGET QrDec)
4 changes: 2 additions & 2 deletions QtQrDec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ include(FetchContent)
FetchContent_Declare(
qrCode
GIT_REPOSITORY https://github.com/EddyTheCo/qrCode.git
GIT_TAG v1.0.0
FIND_PACKAGE_ARGS 1.0 COMPONENTS QtQrDec CONFIG
GIT_TAG vMAJOR.MINOR.PATCH
FIND_PACKAGE_ARGS MAJOR.MINOR COMPONENTS QtQrDec CONFIG
)
FetchContent_MakeAvailable(qrCode)
Expand Down
Loading

0 comments on commit 8b17332

Please sign in to comment.