find_package with NAMES argument forces the CONFIG mode look up.
We accidentally looked for Protobuf uppercase in MODULE mode in
configure.cmake which allowed Protobuf targets be found for tests
and tools. Make this double lookup procedure explicit. All efforts
to support ubuntu/debian platforms, that decline to deliver protobuf
Config files.
Drive-by, use the correct variable to check that Protobuf is found
in golang grpc test server.
Pick-to: 6.9
Change-Id: I50d17aec72540a472bff30782d83e4555c51604a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Ensure that we consider the deprecated Protobuf module version
variable when detecting protoc. Sensitive for the debian like Linux
destributions.
Pick-to: 6.9
Change-Id: I48d32c02af0d2c91e9fd2fed2a913464d585031c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Add the upper and lower case protobuf package names explicitly and keep
the protobuf package lower case for the variables consistency.
Pick-to: 6.9
Change-Id: Id8acf1d986e0274f99587d554e5dc5308f15a31d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This will work around the issue in debian-like platforms, where
relatively new protobuf doesn't deliver the proper config files.
The lookup still prefers looking for the config files, but not
the deprecated CMake module.
Change-Id: Ie1d5217e9023022976dd058be9dd7fd1ce37e39f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
These modules are not relevant anymore. After porting Qt::Grpc
relied on native gRPC implementation. But since we migrated to the
fully functional Qt HTTP/2 the need of reference gRPC and protobuf
gone.
Remove the WrapgRPC and WrapProtobuf modules, use the protobuf
gRPC modules directly in tests examples and tools. Since non of
those never add the build-time depdendcy on reference libraries,
we don't need to add the respective dependencies in Qt packages.
The only thing we still wrap is protoc. We either look for executable
but we never propagate it as the reference target, but utilize the
path from there.
Fixes: QTBUG-128809
Change-Id: Id5008f8dd935288cbaa8a9abb88d485824099d46
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
A couple of things are needed to ensure examples can be built as
external projects.
Change FindWrapgRPCPlugin to look for a cache var in addition to _ROOT
env var, because we can't easily pass env vars to external projects.
Ensure one of the non-Qt test libraries is built with at least C++17
to avoid compilation errors.
Derive a path to absl_ROOT from gRPC_ROOT assuming they are in the
same parent directory.
Use the new QT_EXAMPLE_CMAKE_VARS_TO_PASS variable introduced in
qtbase to allow passing additional cmake variables to all examples
that are built as external projects.
We need to use it for all 3rd party dependencies that have to be
found by the examples.
Make sure to look for GrpcTools package for magic8ball example, to
ensure the public api is available when cross-compiling, but there
is no target native grpc library available.
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: I4420b7348c6a3b02b5516f34a96b19cceaccc649
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
vcpkg installs grpc plugins to the <PREFIX>/tools/grpc directory
which doesn't match the expected by CMake layout. Add hints for
this directories when looking for plugins.
Pick-to: 6.5 6.6
Change-Id: I8dcdb6a86204284521943b60e8113f5c4efd538d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Look for protoc as a program-only when crosscompiling. This avoids
exposing host protobuf libraries to CMake, when looking for host tools.
Pick-to: 6.5 6.5.0
Change-Id: I622a21d422989b4f00a399fad56f4832dc99c536
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This also means adding another library; the Protobuf Well-Known types
library. No other types added from the collection at the moment.
The Any type is like QVariant or std::any in the sense that it can hold
any type. A small string is embedded along with the Any type upon
serializing. This corresponds to some URL, that can be used for
dynamically looking up definitions of types if wanted
(we don't support this), plus the object name.
We use the embedded object name to verify, upon attempting to
deserialize, that the objects are the same. The function is called
as<T>.
Some users may want a as_unchecked<T>, in the future, where we don't do
this, since different messages may be binary compatible but miss some
fields. And this is fine.
Further, the class also contains the raw bytes of its contained message.
We, quite simply, need to deserialize it to some type when requested.
Implementation consists of a helper-class which uses the "real class" we
generate when serializing or deserializing. At some point they could
potentially be collapsed together to avoid extra overhead. But then
the metadata fields need to be dynamically created or manually
maintained.
When asked to serialize/deserialize the class simply proxies calls to
the "real class" underneath
Fixes: QTBUG-103982
Change-Id: Ie9e833cd30aa58afbd5bdd1a9e9c83bdece6f685
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
The function now accepts the list of .proto files as an argument and
calls 'qt6_add_protobuf' implictly. .proto files are treated as an
interface of the module and installed to the module include path.
The respective module include path is added to the target's
QT_PROTO_INCLUDES property for the further use in user projects as
PROTO_INCLUDES argument of 'qt_add_protobuf' and 'qt_add_grpc'
functions.
QtProtobufBuildInternals.cmake is renamed and moved to the correct
directory for the implicit processing by qt_internal_add_module
function.
Pick-to: 6.5
Change-Id: I3322a18a6c487bb8dd0165ce9bca5f84c89cbbd5
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Check required dependencies for gRPC, which are linked as
INTERFACE_LINK_LIBRARIES which results in error when trying to use
gRPC library.
Fixes: QTBUG-109372
Pick-to: 6.5
Change-Id: Ib1adb7f9aff3041c50fabaa47bf269081342a639
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Look for the gRPC libraries using PkgConfig module. This helps to
find gRPC on systems that don't have CMake packages installed.
Task-number: QTBUG-108833
Change-Id: Iaaa9d38facd6490c3d96d9eb30b0cdddde46edde
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
QtGrpc provides support for serializing and deserializing
gRPC services using Qt.
The tool was originally written by Alexey Edelev, along with various
contributors, on GitHub. Originally under MIT license, but major
contributors have agreed to relicense the code under GPL/commercial for
inclusion in tools for Qt. Their copyright notice is retained and
the original source code, still licensed as MIT, can be found in its
original repository[0].
[0]: https://github.com/semlanik/qtprotobuf
Change-Id: Id29e70df1249e9369fbfaa2c543f3ff29efbdbea
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Unlock testing on targeting platforms if they do force building tools.
Since the tool package requires the 'protoc' executable we also
need to make sure that 'protoc' could be found using host package
prefix path. This adds QT_ADDITIONAL_HOST_PACKAGES_PREFIX_PATH to
seach prefixes of the 'protoc' executable.
TODO: We need to add protobuf to the b2qt CI image to build
qtprotobufgen unconditionally.
Change-Id: I29a711fe3c0986d7845d1a0622bc18badfdbd934
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The generator generates Qt-based classes to be used in conjunction with
'QProtobuf' (separate patch).
qtprotobufgen works as an extension to the protoc tool from Google, and
thus also depends on its libraries for building.
The tool was originally written by Alexey Edelev, along with various
contributors, on GitHub. Originally under MIT license, but major
contributors have agreed to relicense the code under GPL/commercial for
inclusion in tools for Qt. Their copyright notice is retained and
the original source code, still licensed as MIT, can be found in its
original repository[0].
[0]: https://github.com/semlanik/qtprotobuf
Done-with: Alexey Edelev <alexey.edelev@qt.io>
Change-Id: I0d5f3d722cb98bca70fc0d4544ed840edb27430c
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>