Skip to content

update CMakeLists to build with Qt 6#256

Open
AlessandroFlorio wants to merge 4 commits into
ftylitak:masterfrom
AlessandroFlorio:cmake
Open

update CMakeLists to build with Qt 6#256
AlessandroFlorio wants to merge 4 commits into
ftylitak:masterfrom
AlessandroFlorio:cmake

Conversation

@AlessandroFlorio
Copy link
Copy Markdown

The provided src/CMakeLists.txt was setup for Qt5, with little adjustments it works perfectly with Qt6.
I set the minimum Qt version to 6.5 since it's the oldest still officially supported, and hence removed the support for Qt5. Anyway, the file could be configured to still support both versions.
Since Qt is also abandoning qmake in favor of cmake, it is crucial to have an updated CMakeLists.txt to build qzxing with cmake.

@AlessandroFlorio
Copy link
Copy Markdown
Author

An upgrade to CMake 3.17 was necessary to solve the following warning:

CMake Warning (dev) in qzxing/src/CMakeLists.txt:
Policy CMP0100 is not set: Let AUTOMOC and AUTOUIC process .hh files. Run "cmake --help-policy CMP0100" for policy details. Use the cmake_policy command to set the policy and suppress this warning. For compatibility, CMake is excluding the header file(s):
"qzxing/src/zxing/bigint/BigInteger.hh"
"qzxing/src/zxing/bigint/BigIntegerAlgorithms.hh"
"qzxing/src/zxing/bigint/BigIntegerLibrary.hh"
"qzxing/src/zxing/bigint/BigIntegerUtils.hh"
"qzxing/src/zxing/bigint/BigUnsigned.hh"
"qzxing/src/zxing/bigint/BigUnsignedInABase.hh"
"qzxing/src/zxing/bigint/NumberlikeArray.hh"
"qzxing/src/zxing/bigint/BigInteger.hh"
"qzxing/src/zxing/bigint/BigIntegerUtils.hh"
"qzxing/src/zxing/bigint/BigUnsigned.hh"
"qzxing/src/zxing/bigint/BigUnsignedInABase.hh"
"qzxing/src/zxing/bigint/BigIntegerAlgorithms.hh"
from processing by AUTOMOC and AUTOUIC. If any of the files should be processed, set CMP0100 to NEW. If any of the files should not be processed, explicitly exclude them by setting the source file property SKIP_AUTOGEN:
set_property(SOURCE file.hh PROPERTY SKIP_AUTOGEN ON)

Updated Qt version to 6.8 since it's the oldest still officially supported.

Added in QZXingFilterVideoSink.h a READ method for the property videoSink to solve the warning

qzxing/src/QZXingFilterVideoSink.h:34:1: warning: Property declaration videoSink has neither an associated QProperty<> member, nor a READ accessor function nor an associated MEMBER variable. The property will be invalid.

Fixed the namespace in ResultIO.cpp to fix the following warning:

qzxing/src/zxing/zxing/ResultIO.cpp:27:10: warning: ‘std::ostream& zxing::operator<<(std::ostream&, zxing::Result&)’ has not been declared within ‘zxing’
In file included from qzxing/src/zxing/zxing/ResultIO.cpp:22:
qzxing/src/zxing/zxing/Result.h:57:24: note: only here as a ‘friend’

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant