Skip to content

Commit

Permalink
Develop (#78)
Browse files Browse the repository at this point in the history
* Added explicit export for Windows shared libs

* Use ifw (#77)

* use common for cpack and exports

* used versioned ccomon and latest dependencies
  • Loading branch information
EddyTheCo authored Mar 28, 2024
1 parent e7483b6 commit 1ae452e
Show file tree
Hide file tree
Showing 17 changed files with 274 additions and 222 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/build-docs.yml

This file was deleted.

50 changes: 45 additions & 5 deletions .github/workflows/build-test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,33 @@ jobs:
matrix:
os: [ubuntu-latest,macos-latest,windows-latest]

uses: EddyTheCo/Common/.github/workflows/build-test-install.yml@v0.1.2
permissions:
contents: write
uses: EddyTheCo/Common/.github/workflows/build-test-install.yml@v0.3.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"
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
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 +48,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
44 changes: 7 additions & 37 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 main
GIT_TAG v0.3.0
)
FetchContent_MakeAvailable(ccommon)
version_from_git(
Expand All @@ -24,50 +24,20 @@ 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)
add_subdirectory(QrGen)
endif(BUILD_QRENC)
add_subdirectory(QtQrDec)
add_subdirectory(QtQrGen)



install(EXPORT ${PROJECT_NAME}-config
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
NAMESPACE ${PROJECT_NAME}::
COMPONENT ${PROJECT_NAME}
)
include(CMakePackageConfigHelpers)
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
VERSION ${VERSION}
COMPATIBILITY SameMajorVersion
)
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}
)
export(EXPORT ${PROJECT_NAME}-config
FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake"
)
build_exports()

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()
build_cpack()
endif(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
if(BUILD_DOCS)
get_target_property(build_docs cmake_build_docs SOURCES)
include(${build_docs})
build_docs()
endif()
2 changes: 1 addition & 1 deletion Config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
include(CMakeFindDependencyMacro)
find_dependency(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick Svg OPTIONAL_COMPONENTS Multimedia )
find_dependency(OpenCV COMPONENTS core objdetect imgproc flann features2d calib3d )
find_dependency(EstervDesigns 1.1 COMPONENTS SimpleStyle CustomControls CONFIG)
find_dependency(EstervDesigns 1.2 COMPONENTS SimpleStyle CustomControls CONFIG)
include ( "${CMAKE_CURRENT_LIST_DIR}/qrCode-config.cmake" )
7 changes: 4 additions & 3 deletions QrDec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,20 @@ 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}
COMPONENT QrDec
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Esterv
COMPONENT ${PROJECT_NAME}
)
else()
message(STATUS "The QRCODE decoding library will not be built")
Expand Down
6 changes: 4 additions & 2 deletions QrDec/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# QrDec

[TOC]

This repo detect and decode a Qr code in a image.
The detection and decoding is performed by [OpenCV](https://opencv.org/) libraries.
In case OpenCV is not found on your system CMake will download pre compiled libraries from [my action releases](https://github.com/EddyTheCo/install-OpenCV-action).
Expand All @@ -10,8 +12,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
7 changes: 4 additions & 3 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}
COMPONENT QrGen
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Esterv
COMPONENT ${PROJECT_NAME}
)

6 changes: 4 additions & 2 deletions QrGen/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# QrGen

[TOC]

The code is based on [QR Code generator library](https://github.com/nayuki/QR-Code-generator) and produce a library for the generation of a QR code of certain data.

## Adding the libraries to your CMake project
Expand All @@ -8,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 QrGen CONFIG
GIT_TAG vMAJOR.MINOR.PATCH
FIND_PACKAGE_ARGS MAJOR.MINOR COMPONENTS QrGen CONFIG
)
FetchContent_MakeAvailable(qrCode)
Expand Down
Loading

0 comments on commit 1ae452e

Please sign in to comment.