-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* use common cmake and workflows * build documentation and release * use cmake components * set the export to the qrCode * add ctest to have the test target * added alias target to use namespaces also
- Loading branch information
Showing
11 changed files
with
147 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: build-docs | ||
run-name: ${{ github.actor }} ${{ github.event_name }} to ${{ github.base_ref }} | ||
on: | ||
pull_request_target: | ||
types: [closed] | ||
branches: [main] | ||
jobs: | ||
build_doxygen: | ||
uses: EddyTheCo/Common/.github/workflows/build-docs.yml@main | ||
if: ${{ (github.event.pull_request.merged == true) && (startsWith(github.base_ref, 'main')) }} | ||
permissions: | ||
pages: write | ||
id-token: write |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: push-build-release | ||
run-name: ${{ github.actor }} ${{ github.event_name }} to ${{ github.base_ref }} | ||
on: | ||
|
||
push: | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
types: [opened,reopened] | ||
branches: [develop] | ||
jobs: | ||
build_test_package: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest,macos-latest,windows-latest] | ||
sharedLib: [true,false] | ||
|
||
uses: EddyTheCo/Common/.github/workflows/build-test-install.yml@main | ||
permissions: | ||
contents: write | ||
with: | ||
os: ${{ matrix.os }} | ||
sharedLib: ${{ matrix.sharedLib }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.git/ | ||
doc/html/ | ||
doc/*.tag | ||
*.swp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@PACKAGE_INIT@ | ||
|
||
include ( "${CMAKE_CURRENT_LIST_DIR}/qrCodeTargets.cmake" ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,26 @@ | ||
cmake_minimum_required(VERSION 3.11 FATAL_ERROR) | ||
|
||
project(QrCodeGenLib VERSION 0.1 DESCRIPTION "library for qr codes generation" LANGUAGES CXX) | ||
|
||
|
||
set(default_build_type "Release") | ||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) | ||
message(STATUS "Setting build type to '${default_build_type}' as none was specified.") | ||
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE | ||
STRING "Choose the type of build." FORCE) | ||
# Set the possible values of build type for cmake-gui | ||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS | ||
"Debug" "Release" "MinSizeRel" "RelWithDebInfo") | ||
endif() | ||
|
||
set_property(GLOBAL PROPERTY USE_FOLDERS ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
project(QrGeneration LANGUAGES CXX) | ||
|
||
add_library(QrGen src/qrcodegen.cpp src/utils.cpp include/qrcodegen.hpp) | ||
|
||
add_library(qrCode::QrGen ALIAS QrGen) | ||
set_target_properties(QrGen PROPERTIES POSITION_INDEPENDENT_CODE ON) | ||
|
||
target_compile_features(QrGen PUBLIC cxx_std_11) | ||
|
||
|
||
|
||
target_include_directories(QrGen PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
"$<INSTALL_INTERFACE:include>") | ||
|
||
install(TARGETS QrGen EXPORT QrGenTargets DESTINATION lib) | ||
install(DIRECTORY include/ DESTINATION include/) | ||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/qrCode>") | ||
|
||
install(EXPORT QrGenTargets | ||
FILE QrGenTargets.cmake | ||
NAMESPACE qr:: | ||
DESTINATION lib/cmake/QrGen | ||
) | ||
include(CMakePackageConfigHelpers) | ||
# generate the config file that is includes the exports | ||
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in | ||
"${CMAKE_CURRENT_BINARY_DIR}/QrGenConfig.cmake" | ||
INSTALL_DESTINATION "lib/cmake/QrGen" | ||
NO_SET_AND_CHECK_MACRO | ||
NO_CHECK_REQUIRED_COMPONENTS_MACRO | ||
) | ||
write_basic_package_version_file( | ||
"${CMAKE_CURRENT_BINARY_DIR}/QrGenConfigVersion.cmake" | ||
VERSION "0.1.1.0" | ||
COMPATIBILITY AnyNewerVersion | ||
install(TARGETS QrGen | ||
EXPORT qrCode-config | ||
DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
COMPONENT Qr | ||
) | ||
install(FILES | ||
${CMAKE_CURRENT_BINARY_DIR}/QrGenConfig.cmake | ||
${CMAKE_CURRENT_BINARY_DIR}/QrGenConfigVersion.cmake | ||
DESTINATION lib/cmake/QrGen | ||
) | ||
export(EXPORT QrGenTargets | ||
FILE "${CMAKE_CURRENT_BINARY_DIR}/QrGenTargets.cmake" | ||
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/include/ | ||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qrCode | ||
COMPONENT Qr | ||
) | ||
|
||
if(BUILD_DOCS) | ||
get_target_property(build_docs cmake_build_docs SOURCES) | ||
include(${build_docs}) | ||
endif() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,37 @@ | ||
cmake_minimum_required(VERSION 3.16) | ||
project(qmlqr LANGUAGES CXX) | ||
project(QrGeneration LANGUAGES CXX) | ||
|
||
set(CMAKE_AUTOMOC ON) | ||
include(local_conf.cmake OPTIONAL) | ||
find_package(Qt6 COMPONENTS Core Gui Qml Quick Svg) | ||
if (Qt6_FOUND) | ||
qt_add_library(QtQrGen Qrimageprovider.cpp include/Qrimageprovider.hpp) | ||
|
||
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick Core5Compat Svg) | ||
add_library(qrCode::QtQrGen ALIAS QtQrGen) | ||
target_include_directories(QtQrGen PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/qrCode>") | ||
|
||
qt_add_library(QtQrGen Qrimageprovider.cpp include/Qrimageprovider.hpp) | ||
|
||
set_target_properties(QtQrGen PROPERTIES | ||
WIN32_EXECUTABLE TRUE | ||
MACOSX_BUNDLE TRUE | ||
) | ||
target_include_directories(QtQrGen PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
"$<INSTALL_INTERFACE:include>") | ||
target_link_libraries(QtQrGen PUBLIC | ||
Qt6::Quick | ||
) | ||
target_link_libraries(QtQrGen PRIVATE | ||
QrGen | ||
Qt6::Core | ||
Qt6::Gui | ||
Qt6::Qml | ||
Qt6::Quick | ||
Qt6::Core5Compat | ||
Qt6::Svg | ||
) | ||
target_link_libraries(QtQrGen PUBLIC | ||
Qt6::Quick | ||
) | ||
target_link_libraries(QtQrGen PRIVATE | ||
QrGen | ||
Qt6::Core | ||
Qt6::Gui | ||
Qt6::Qml | ||
Qt6::Quick | ||
Qt6::Svg | ||
) | ||
|
||
install(TARGETS QtQrGen EXPORT QtQrGenTargets LIBRARY DESTINATION lib) | ||
install(DIRECTORY include/ DESTINATION include/) | ||
|
||
install(EXPORT QtQrGenTargets | ||
FILE QtQrGenTargets.cmake | ||
NAMESPACE qr:: | ||
DESTINATION lib/cmake/QtQrGen | ||
) | ||
include(CMakePackageConfigHelpers) | ||
# generate the config file that is includes the exports | ||
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in | ||
"${CMAKE_CURRENT_BINARY_DIR}/QtQrGenConfig.cmake" | ||
INSTALL_DESTINATION "lib/cmake/QtQrGen" | ||
NO_SET_AND_CHECK_MACRO | ||
NO_CHECK_REQUIRED_COMPONENTS_MACRO | ||
) | ||
write_basic_package_version_file( | ||
"${CMAKE_CURRENT_BINARY_DIR}/QtQrGenConfigVersion.cmake" | ||
VERSION "0.1.1.0" | ||
COMPATIBILITY AnyNewerVersion | ||
) | ||
install(FILES | ||
${CMAKE_CURRENT_BINARY_DIR}/QtQrGenConfig.cmake | ||
${CMAKE_CURRENT_BINARY_DIR}/QtQrGenConfigVersion.cmake | ||
DESTINATION lib/cmake/QtQrGen | ||
) | ||
export(EXPORT QtQrGenTargets | ||
FILE "${CMAKE_CURRENT_BINARY_DIR}/QtQrGenTargets.cmake" | ||
) | ||
install(TARGETS QtQrGen | ||
EXPORT qrCode-config | ||
DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
COMPONENT QtQr | ||
) | ||
install(DIRECTORY include/ | ||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qrCode | ||
COMPONENT QtQr | ||
) | ||
endif(Qt6_FOUND) | ||
if(BUILD_DOCS) | ||
get_target_property(build_docs cmake_build_docs SOURCES) | ||
include(${build_docs}) | ||
endif() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters