Find and use packaged version of qr-code-generator library.
Disabled by default until upstream will merge proposed PR. Can be enabled by forwarding `-DDESKTOP_APP_USE_PACKAGED_QRCODE:BOOL=ON` cmake build option. Signed-off-by: Vitaly Zaitsev <vitaly@easycoding.org>
This commit is contained in:
parent
2793a8d3be
commit
808982a65e
2 changed files with 30 additions and 18 deletions
47
external/qr_code_generator/CMakeLists.txt
vendored
47
external/qr_code_generator/CMakeLists.txt
vendored
|
|
@ -4,24 +4,35 @@
|
||||||
# For license and copyright information please follow this link:
|
# For license and copyright information please follow this link:
|
||||||
# https://github.com/desktop-app/legal/blob/master/LEGAL
|
# https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||||
|
|
||||||
add_library(external_qr_code_generator OBJECT)
|
if (DESKTOP_APP_USE_PACKAGED_QRCODE)
|
||||||
add_library(desktop-app::external_qr_code_generator ALIAS external_qr_code_generator)
|
add_library(external_qr_code_generator INTERFACE IMPORTED GLOBAL)
|
||||||
init_target(external_qr_code_generator "(external)")
|
add_library(desktop-app::external_qr_code_generator ALIAS external_qr_code_generator)
|
||||||
|
|
||||||
set(qr_loc ${third_party_loc}/QR)
|
find_library(QRCODE_LIBRARY NAMES "qrcodegencpp")
|
||||||
set(qr_src ${qr_loc}/cpp)
|
find_path(QRCODE_INCLUDE_DIRS "qrcodegencpp/QrCode.hpp")
|
||||||
|
|
||||||
nice_target_sources(external_qr_code_generator ${qr_src}
|
target_include_directories(external_qr_code_generator INTERFACE ${QRCODE_INCLUDE_DIRS})
|
||||||
PRIVATE
|
target_link_libraries(external_qr_code_generator INTERFACE ${QRCODE_LIBRARY})
|
||||||
BitBuffer.cpp
|
else()
|
||||||
BitBuffer.hpp
|
add_library(external_qr_code_generator OBJECT)
|
||||||
QrCode.cpp
|
add_library(desktop-app::external_qr_code_generator ALIAS external_qr_code_generator)
|
||||||
QrCode.hpp
|
init_target(external_qr_code_generator "(external)")
|
||||||
QrSegment.cpp
|
|
||||||
QrSegment.hpp
|
|
||||||
)
|
|
||||||
|
|
||||||
target_include_directories(external_qr_code_generator
|
set(qr_loc ${third_party_loc}/QR)
|
||||||
PUBLIC
|
set(qr_src ${qr_loc}/cpp)
|
||||||
${qr_src}
|
|
||||||
)
|
nice_target_sources(external_qr_code_generator ${qr_src}
|
||||||
|
PRIVATE
|
||||||
|
BitBuffer.cpp
|
||||||
|
BitBuffer.hpp
|
||||||
|
QrCode.cpp
|
||||||
|
QrCode.hpp
|
||||||
|
QrSegment.cpp
|
||||||
|
QrSegment.hpp
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(external_qr_code_generator
|
||||||
|
PUBLIC
|
||||||
|
${qr_src}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ option(DESKTOP_APP_USE_PACKAGED_RLOTTIE "Find rlottie using CMake instead of bun
|
||||||
option(DESKTOP_APP_USE_PACKAGED_EXPECTED "Find expected using CMake instead of bundled one." ${DESKTOP_APP_USE_PACKAGED})
|
option(DESKTOP_APP_USE_PACKAGED_EXPECTED "Find expected using CMake instead of bundled one." ${DESKTOP_APP_USE_PACKAGED})
|
||||||
option(DESKTOP_APP_USE_PACKAGED_VARIANT "Find mapbox-variant using CMake instead of bundled one." ${DESKTOP_APP_USE_PACKAGED})
|
option(DESKTOP_APP_USE_PACKAGED_VARIANT "Find mapbox-variant using CMake instead of bundled one." ${DESKTOP_APP_USE_PACKAGED})
|
||||||
option(DESKTOP_APP_USE_PACKAGED_GSL "Find GSL using CMake instead of bundled one." ${DESKTOP_APP_USE_PACKAGED})
|
option(DESKTOP_APP_USE_PACKAGED_GSL "Find GSL using CMake instead of bundled one." ${DESKTOP_APP_USE_PACKAGED})
|
||||||
|
option(DESKTOP_APP_USE_PACKAGED_QRCODE "Find qr-code-generator library using CMake instead of bundled one." OFF)
|
||||||
option(DESKTOP_APP_USE_PACKAGED_FONTS "Use preinstalled fonts instead of bundled one." ${DESKTOP_APP_USE_PACKAGED})
|
option(DESKTOP_APP_USE_PACKAGED_FONTS "Use preinstalled fonts instead of bundled one." ${DESKTOP_APP_USE_PACKAGED})
|
||||||
|
|
||||||
option(DESKTOP_APP_ENABLE_IPO_OPTIMIZATIONS "Enable IPO build optimizations." OFF)
|
option(DESKTOP_APP_ENABLE_IPO_OPTIMIZATIONS "Enable IPO build optimizations." OFF)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue