Skip to content

Commit

Permalink
Build docs (#6) (#7)
Browse files Browse the repository at this point in the history
* add the build docs on the root cmake for creating doxygen doc target

* started working on decoding

* fix the link to qmlonline on readmes
  • Loading branch information
EddyTheCo authored Jun 1, 2023
1 parent 78ed7b8 commit 8d7836b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 54 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,7 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
endif(NOT BUILD_SHARED_LIBS)
include(CPack)
endif()
if(BUILD_DOCS)
get_target_property(build_docs cmake_build_docs SOURCES)
include(${build_docs})
endif()
80 changes: 27 additions & 53 deletions QtQrDec/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,62 +1,36 @@
cmake_minimum_required(VERSION 3.16)
project(qmlqr LANGUAGES CXX)

set(CMAKE_AUTOMOC ON)
include(local_conf.cmake OPTIONAL)

find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)

qt_add_library(QtQrDec Qrimagedecoder.cpp include/Qrimagedecoder.hpp)

set_target_properties(QtQrDec PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
target_include_directories(QtQrDec PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
"$<INSTALL_INTERFACE:include>")
"$<INSTALL_INTERFACE:include>")

target_link_libraries(QtQrDec PUBLIC
Qt6::Core
Qt6::Qml
)
Qt6::Core
Qt6::Qml
)
target_link_libraries(QtQrDec PRIVATE
QrDec
Qt6::Gui
Qt6::Quick
)


install(TARGETS QtQrDec EXPORT QtQrDecTargets LIBRARY DESTINATION lib)
install(DIRECTORY include/ DESTINATION include/)

install(EXPORT QtQrDecTargets
FILE QtQrDecTargets.cmake
NAMESPACE qr::
DESTINATION lib/cmake/QtQrDec
)
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}/QtQrDecConfig.cmake"
INSTALL_DESTINATION "lib/cmake/QtQrDec"
NO_SET_AND_CHECK_MACRO
NO_CHECK_REQUIRED_COMPONENTS_MACRO
)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/QtQrDecConfigVersion.cmake"
VERSION "0.1.1.0"
COMPATIBILITY AnyNewerVersion
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/QtQrDecConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/QtQrDecConfigVersion.cmake
DESTINATION lib/cmake/QtQrDec
)
export(EXPORT QtQrDecTargets
FILE "${CMAKE_CURRENT_BINARY_DIR}/QtQrDecTargets.cmake"
)

include(CTest)


add_subdirectory(tests)
QrDec
Qt6::Gui
Qt6::Quick
)

install(TARGETS QtQrDec
EXPORT ${PROJECT_NAME}-config
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT QtQr
install(DIRECTORY include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}
COMPONENT QtQr
)


if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
include(CTest)
if(BUILD_TESTING)
add_subdirectory(tests)
endif(BUILD_TESTING)
endif(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)


3 changes: 2 additions & 1 deletion QtQrGen/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# 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/index.html?example_url=https://raw.githubusercontent.com/EddyTheCo/qmlonline/main/wasm/examples/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).
You can play with the resulting ImageProvider on [this page](https://eddytheco.github.io/qmlonline/wasm/?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 8d7836b

Please sign in to comment.