@@ -13,7 +13,7 @@ set(APP_VERSION ${CMAKE_PROJECT_VERSION})
1313
1414option (USE_QZXING "Build with QZXing support (decoder&encoder)" OFF )
1515option (USE_ZXINGCPP "Build with zxing-cpp support (decoder&encoder)" ON )
16- option (USE_ZINT "Build with zint support (encoder)" ON )
16+ option (USE_ZINT "Build with zint support (encoder)" OFF )
1717
1818################################################################################
1919
@@ -56,12 +56,15 @@ set(SOURCES
5656 thirdparty/IconLibrary/IconLibrary_material.qrc
5757)
5858
59- if (IOS OR ANDROID )
60- # Mobile
59+ if (IOS OR ANDROID ) # Mobile
60+
6161 set (QAPPLICATION_CLASS QGuiApplication)
62- else ()
63- # Desktop
62+ set (USE_ZINT OFF )
63+
64+ else () # Desktop
65+
6466 set (QAPPLICATION_CLASS QApplication)
67+ set (USE_ZINT ON )
6568
6669 # Set app icons
6770 #if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
@@ -162,16 +165,12 @@ if(USE_ZXINGCPP)
162165 # build zxing-cpp Qt wrapper
163166 add_subdirectory (thirdparty/zxing-cpp/wrappers/qt )
164167 target_link_libraries (${CMAKE_PROJECT_NAME } PRIVATE ZXingQt )
165-
166- set (zxingcpp true )
167- add_definitions (-Dzxingcpp )
168+ target_compile_definitions (${CMAKE_PROJECT_NAME } PRIVATE QMS_USE_ZXINGCPP )
168169elseif (USE_QZXING)
169170 # build QZxing
170171 add_subdirectory (thirdparty/QZXing )
171172 target_link_libraries (${CMAKE_PROJECT_NAME } PRIVATE QZXing )
172-
173- set (qzxing true )
174- add_definitions (-Dqzxing )
173+ target_compile_definitions (${CMAKE_PROJECT_NAME } PRIVATE QMS_USE_QZXING )
175174else ()
176175endif ()
177176
@@ -183,9 +182,7 @@ if(USE_ZINT)
183182 # build ZintQml
184183 add_subdirectory (thirdparty/zint-qml/wrappers/qml )
185184 target_link_libraries (${CMAKE_PROJECT_NAME } PRIVATE ZintQml )
186-
187- set (zint true )
188- add_definitions (-Dzint )
185+ target_compile_definitions (${CMAKE_PROJECT_NAME } PRIVATE QMS_USE_ZINT )
189186endif ()
190187
191188# Qt libraries
0 commit comments