From f5c99d347b80e57830e5182505b12c7cb1283936 Mon Sep 17 00:00:00 2001 From: Philip Schuchardt Date: Mon, 5 Jul 2021 21:46:35 -0400 Subject: [PATCH 1/3] Properly exported the defines for CMake users - CMake users can now use QZXING_USE_ENCODER to enable QR code encoding - definitions are export correctly for including projects - CMake users no longer have to manually add the definitions into src/CMakeLists.txt --- src/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9ead55e..ce94440 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -38,6 +38,10 @@ if(QZXING_USE_QML) add_definitions(-DQZXING_QML) endif(QZXING_USE_QML) +if(QZXING_USE_ENCODER) + add_definitions(-DENABLE_ENCODER_GENERIC -DENABLE_ENCODER_QR_CODE) +endif(QZXING_USE_ENCODER) + add_library(qzxing "" ${SOURCES}) if(WIN32) @@ -61,6 +65,7 @@ target_link_libraries(qzxing Qt5::Core Qt5::Gui) if(QZXING_MULTIMEDIA) target_link_libraries(qzxing Qt5::Multimedia) + target_compile_definitions(qzxing PUBLIC -DQZXING_MULTIMEDIA) endif(QZXING_MULTIMEDIA) if(QZXING_USE_QML) @@ -68,8 +73,13 @@ if(QZXING_USE_QML) Qt5::Svg Qt5::Quick Qt5::QuickControls2) + target_compile_definitions(qzxing PUBLIC -DQZXING_QML) endif(QZXING_USE_QML) +if(QZXING_USE_ENCODER) + target_compile_definitions(qzxing PUBLIC -DENABLE_ENCODER_GENERIC -DENABLE_ENCODER_QR_CODE) +endif(QZXING_USE_ENCODER) + # Change Global Definitions depending on how you want to use the library target_compile_definitions(qzxing PUBLIC DISABLE_LIBRARY_FEATURES) From a47e28f9bd72bd79fc56ad5676dc2757fd57c2eb Mon Sep 17 00:00:00 2001 From: Philip Schuchardt Date: Tue, 6 Jul 2021 00:59:10 -0400 Subject: [PATCH 2/3] Added decoder defines into CMakeLists CMake users can now enable or disable individualdecodings --- src/CMakeLists.txt | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ce94440..b58b0ea 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -80,6 +80,31 @@ if(QZXING_USE_ENCODER) target_compile_definitions(qzxing PUBLIC -DENABLE_ENCODER_GENERIC -DENABLE_ENCODER_QR_CODE) endif(QZXING_USE_ENCODER) +if(QZXING_USE_DECODER_QR_CODE) + target_compile_definitions(qzxing PRIVATE -DENABLE_DECODER_QR_CODE) +endif() + +if(QZXING_USE_DECODER_1D_BARCODES) + target_compile_definitions(qzxing PRIVATE -DENABLE_DECODER_1D_BARCODES) +endif() + +if(QZXING_USE_DECODER_DATA_MATRIX) + target_compile_definitions(qzxing PRIVATE -DENABLE_DECODER_DATA_MATRIX) +endif() + +if(QZXING_USE_DECODER_AZTEC) + target_compile_definitions(qzxing PRIVATE -DENABLE_DECODER_AZTEC) +endif() + +if(QZXING_USE_DECODER_PDF17) + target_compile_definitions(qzxing PRIVATE -DENABLE_DECODER_PDF17) +endif() + +if(QZXING_USE_DECODER_1D_BARCODES) + target_compile_definitions(qzxing PRIVATE -DENABLE_DECODER_1D_BARCODES) +endif() + + # Change Global Definitions depending on how you want to use the library target_compile_definitions(qzxing PUBLIC DISABLE_LIBRARY_FEATURES) From 1c4e738b913790b78af4d6c441488b7c8cdce843 Mon Sep 17 00:00:00 2001 From: Philip Schuchardt Date: Tue, 6 Jul 2021 00:59:30 -0400 Subject: [PATCH 3/3] Disables iconv for Android --- src/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b58b0ea..c77f38d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -53,6 +53,10 @@ if(WIN32) add_definitions(-DNO_ICONV) endif(WIN32) +if(ANDROID) + add_definitions(-DNO_ICONV) +endif() + if(VS_WINRT_COMPONENT) add_definitions(-DNO_ICONV) endif(VS_WINRT_COMPONENT)