Skip to content

Commit 21f5ec9

Browse files
committed
Bump version to 0.4, update project build files
1 parent d90f6bf commit 21f5ec9

7 files changed

Lines changed: 61 additions & 46 deletions

File tree

CMakeLists.txt

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
cmake_minimum_required(VERSION 3.20)
22

3-
project(QmlMobileScanner VERSION 0.3 LANGUAGES C CXX)
3+
project(QmlMobileScanner VERSION 0.4 LANGUAGES C CXX)
44

55
set(CMAKE_CXX_STANDARD 20)
66
set(CMAKE_CXX_STANDARD_REQUIRED ON)
77
set(CMAKE_AUTOMOC ON)
88
set(CMAKE_AUTORCC ON)
99
set(CMAKE_INCLUDE_CURRENT_DIR ON)
1010

11-
string(TIMESTAMP CURRENT_TIMESTAMP "%s" UTC)
1211
set(APP_NAME ${CMAKE_PROJECT_NAME})
1312
set(APP_VERSION ${CMAKE_PROJECT_VERSION})
14-
set(APP_VERSION_CODE ${TIMESTAMP})
13+
14+
option(USE_QZXING "Build with QZXing support (decoder&encoder)" OFF)
15+
option(USE_ZXINGCPP "Build with zxing-cpp support (decoder&encoder)" ON)
16+
option(USE_ZINT "Build with zint support (encoder)" OFF)
1517

1618
################################################################################
1719

@@ -51,7 +53,7 @@ set(SOURCES
5153
thirdparty/IconLibrary/IconLibrary_material.qrc
5254
)
5355

54-
if(IOS OR ANDROID)
56+
if (IOS OR ANDROID)
5557
# Mobile
5658
set(QAPPLICATION_CLASS QGuiApplication)
5759
else()
@@ -128,14 +130,12 @@ target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE
128130
Qt6::QuickControls2
129131
)
130132

131-
if(NOT IOS AND NOT ANDROID)
133+
if (NOT IOS AND NOT ANDROID)
132134
# for proper systray and menubar support
133135
find_package(Qt6 REQUIRED COMPONENTS Widgets)
134136
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE Qt6::Widgets)
135137
endif()
136138

137-
add_definitions(-DENABLE_ZXING)
138-
139139
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
140140
#
141141
endif()
@@ -160,30 +160,44 @@ target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE MobileSharing)
160160
add_subdirectory(thirdparty/ComponentLibrary)
161161
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE ComponentLibraryplugin)
162162

163-
# QZxing-cpp
164-
#set(qzxing true)
165-
#add_definitions(-Dqzxing)
166-
#add_subdirectory(thirdparty/QZXing)
167-
#target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE QZXing)
163+
if (USE_ZXINGCPP)
164+
# build zxing-cpp
165+
add_subdirectory(thirdparty/zxing-cpp)
166+
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE ZXing)
167+
168+
# build zxing-cpp Qt wrapper
169+
add_subdirectory(thirdparty/zxing-cpp/wrappers/qt)
170+
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE ZXingQt)
171+
172+
set(zxingcpp true)
173+
add_definitions(-Dzxingcpp)
174+
elseif (USE_QZXING)
175+
# build QZxing
176+
add_subdirectory(thirdparty/QZXing)
177+
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE QZXing)
168178

169-
# zxing-cpp
170-
add_subdirectory(thirdparty/zxing-cpp)
171-
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE ZXing)
179+
set(qzxing true)
180+
add_definitions(-Dqzxing)
181+
else()
182+
endif()
172183

173-
# zxing-cpp Qt wrapper
174-
set(zxingcpp true)
175-
add_definitions(-Dzxingcpp)
176-
add_subdirectory(thirdparty/zxing-cpp/wrappers/qt/)
177-
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE ZXingQt)
184+
if (USE_ZINT)
185+
# build zint
186+
add_subdirectory(thirdparty/zint-qml)
187+
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE zint)
178188

179-
#CONFIG += zint
180-
#add_subdirectory(thirdparty/zint)
181-
#target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE zint)
189+
# build ZintQml
190+
add_subdirectory(thirdparty/zint-qml/wrappers/qml)
191+
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE ZintQml)
192+
193+
set(zint true)
194+
add_definitions(-Dzint)
195+
endif()
182196

183197
################################################################################
184198

185199
## Android
186-
if(CMAKE_SYSTEM_NAME STREQUAL "Android")
200+
if (CMAKE_SYSTEM_NAME STREQUAL "Android")
187201
set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES
188202
#QT_ANDROID_ABIS "armeabi-v7a;arm64-v8a;x86;x86_64"
189203
#QT_ANDROID_BUILD_ALL_ABIS ON
@@ -194,7 +208,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Android")
194208
endif()
195209

196210
## macOS
197-
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
211+
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
198212
#set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64")
199213
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0")
200214

@@ -212,7 +226,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
212226
endif()
213227

214228
## iOS
215-
if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
229+
if (CMAKE_SYSTEM_NAME STREQUAL "iOS")
216230
#set(app_icon_ios "${CMAKE_SOURCE_DIR}/assets/ios/Assets.xcassets")
217231
#set_source_files_properties(${app_icon_ios} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
218232

@@ -234,7 +248,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
234248
endif()
235249

236250
## Windows
237-
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
251+
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
238252
#set(app_icon_windows "${CMAKE_SOURCE_DIR}/assets/windows/${CMAKE_PROJECT_NAME}.rc")
239253

240254
set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES
@@ -243,7 +257,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
243257
endif()
244258

245259
## Release build? Set "no debug" macros
246-
if(CMAKE_BUILD_TYPE STREQUAL Release)
260+
if (CMAKE_BUILD_TYPE STREQUAL Release)
247261
target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE
248262
NDEBUG
249263
QT_NO_DEBUG

QmlMobileScanner.pro

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
TARGET = QmlMobileScanner
22

3-
VERSION = 0.2
3+
VERSION = 0.4
44
DEFINES+= APP_NAME=\\\"$$TARGET\\\"
55
DEFINES+= APP_VERSION=\\\"$$VERSION\\\"
66

7-
CONFIG += c++17
7+
CONFIG += c++20
88
QT += core qml quickcontrols2 svg
99
QT += multimedia concurrent sql positioning
1010

@@ -53,10 +53,11 @@ HEADERS += src/DatabaseManager.h \
5353
src/Barcode.h \
5454
src/utils_camera.h
5555

56-
INCLUDEPATH += src/ src/thirdparty/
56+
INCLUDEPATH += src/ thirdparty/
5757

58-
RESOURCES += qml/ComponentLibrary/ComponentLibrary.qrc
59-
RESOURCES += qml/qml.qrc assets/assets.qrc assets/icons.qrc
58+
RESOURCES += thirdparty/ComponentLibrary/ComponentLibrary.qrc
59+
RESOURCES += thirdparty/IconLibrary/IconLibrary_material.qrc
60+
RESOURCES += qml/qml.qrc assets/assets.qrc
6061

6162
OTHER_FILES += .gitignore \
6263
.github/workflows/builds_mobile.yml \
@@ -65,30 +66,30 @@ OTHER_FILES += .gitignore \
6566
# Project dependencies #########################################################
6667

6768
# AppUtils
68-
include(src/thirdparty/AppUtils/AppUtils.pri)
69+
include(thirdparty/AppUtils/AppUtils.pri)
6970

7071
# Utils for mobile OS
71-
include(src/thirdparty/MobileUI/MobileUI.pri)
72-
include(src/thirdparty/MobileSharing/MobileSharing.pri)
72+
include(thirdparty/MobileUI/MobileUI.pri)
73+
include(thirdparty/MobileSharing/MobileSharing.pri)
7374

7475
# Barcode reader/writer (zxing-cpp)
7576
CONFIG(zxingcpp, zxingcpp|qzxing) {
7677
message("Building QmlMobileScanner with zxing-cpp backend")
77-
include(src/thirdparty/zxing-cpp/zxing-cpp.pri)
78+
include(thirdparty/zxing-cpp/zxing-cpp.pri)
7879
DEFINES += zxingcpp
7980
}
8081

8182
# Barcode reader/writer (QZXing)
8283
CONFIG(qzxing, zxingcpp|qzxing) {
8384
message("Building QmlMobileScanner with QZXing backend")
84-
include(src/thirdparty/QZXing/QZXing.pri)
85+
include(thirdparty/QZXing/QZXing.pri)
8586
DEFINES += qzxing
8687
}
8788

8889
# Barcode writer (zint)
8990
CONFIG(zint) {
9091
message("Building QmlMobileScanner with zint backend")
91-
include(src/thirdparty/zint-qml/zint-qml.pri)
92+
include(thirdparty/zint-qml/zint-qml.pri)
9293
DEFINES += zint
9394
}
9495

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ QmlMobileScanner is a DEMO barcode & QR code scanner based on qzxing and zxing-c
1010
Available backends:
1111
- QZXing / v3.3.0 + Qt6 port + many patches
1212
- zxing-cpp / v2.3.0 + custom QML integration
13-
- zint / v2.13 + custom QML integration
13+
- zint / v2.15 + custom QML integration
1414

1515
> Works on Android and iOS!
1616

assets/android/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto"
3-
android:versionCode="00030001" android:versionName="0.3">
3+
android:versionCode="00040001" android:versionName="0.4">
44

55
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" />
66

assets/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ android {
8787
ndk.abiFilters = qtTargetAbiList.split(",")
8888

8989
namespace 'io.emeric.qmlmobilescanner'
90-
versionName "0.3"
90+
versionName "0.4"
9191
versionCode timestampInt
9292
manifestPlaceholders = [versionName: versionName, versionCode: versionCode]
9393
}

assets/ios/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
<string>io.emeric.qmlmobilescanner</string>
2222

2323
<key>CFBundleVersion</key>
24-
<string>000301</string>
24+
<string>000401</string>
2525

2626
<key>CFBundleShortVersionString</key>
27-
<string>0.3</string>
27+
<string>0.4</string>
2828

2929
<key>CFBundleDevelopmentRegion</key>
3030
<string>English</string>

assets/macos/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
<string>QmlMobileScanners.icns</string>
2525

2626
<key>CFBundleVersion</key>
27-
<string>000301</string>
27+
<string>000401</string>
2828

2929
<key>CFBundleShortVersionString</key>
30-
<string>0.3</string>
30+
<string>0.4</string>
3131

3232
<key>LSMinimumSystemVersion</key>
3333
<string>11.0</string>

0 commit comments

Comments
 (0)