Previously the helper returned early in case no service section was
found in the proto file. If we supply multiple files, this function
should simply skip those. Otherwise it's not possible to process such a
list variable.
Pick-to: 6.10 6.9 6.8
Change-Id: Iab31fa81404f2df2ec4ad628810ff7f948b3eb5f
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
If preparsing of the .proto schemes doesn't detect the definitions
that can be processed by our generators, make the early return
from qt6_add_<protobuf|grpc> with the respective warning message.
We require that provided .proto files contain either message/enum
for protobuf generator or services for the grpc generator.
The warning can be suppressed by setting the
QT_SKIP_PROTOBUF_MISSING_DEFINITIONS_WARNING variable to TRUE.
[ChangeLog][CMake] The qt6_add_protobuf and qt6_add_grpc functions
do not generate CMake targets if provided in PROTO_FILES argument
protobuf schemes do not contain the corresponding for the generator
definitions. qtprotobufgen requires messages or enums, qtgrpcgen
requires services. Functions now make early return and warn about the
missing definitions. Previosly the functions generated unclear
FATAL_ERROR. The QT_SKIP_PROTOBUF_MISSING_DEFINITIONS_WARNING CMake
variable suppresses the warning.
Pick-to: 6.8 6.9
Fixes: QTBUG-132848
Change-Id: I620c2b5bab719a61510c5cbc2ae8224e3df70fcf
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
QML option of both qt_add_protobuf and qt_add_grpc calls requires
ProtobufQuick and GrpcQuick targets to be found, accordingly.
Currently calls will fail with non-intuitive error that points to
the missing linking dependencies. Trigger a FATAL_ERROR at configure
time and give a hint on how to solve this.
Fixes: QTBUG-131780
Pick-to: 6.8 6.9
Change-Id: I571aa35839a6b68b54f5a71f0ee1947445b5eb2c
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We survived the 6.8 API review and, as a result, we’ve been promoted to
first-class Qt citizens. Time to retire the technical-preview label and
let these modules enjoy their new status.
Remove all mentions of technical preview from the module.
Pick-to: 6.8.0 6.8
Change-Id: I0adc9db13f9845119776ea7e2a2f666414bf9620
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
When building static libraries or shared libraries on Windows platforms
we need to make sure that _protobuf_registration targets depend on the
generated cpp exports. This add the header file containing exports as
the source file to the _protobuf_registration targets and also
makes sure that we add the dependencies when using both qt_add_protobuf
and qt_add_grpc calls on the same target.
Pick-to: 6.7
Change-Id: Ibc6c04e363093c54dc7ff1725fc6e816b3c9ffdf
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Make the generating of C++ exports common for both generators.
The confilicting generation should be resolved by the tools that
running the generators. Qt CMake API handles this situation.
Fixes: QTBUG-121856
Pick-to: 6.7
Change-Id: Ie2452f52d755ade2909107885dac774ff8678daa
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Consider the EXPORT_MACRO CMake argument of qt_add_<protobuf|grpc>
calls.
Add the support for the EXPORT_MACRO option extras to the
qt<protobuf|grpc>gen generators. The extras now allow setting:
- export file name
- boolean flag that indicates if export file needs to be generated
The EXPORT_MACRO option of the generators now has the following format:
EXPORT_MACRO=<export_name>[:export_filename[:<true|false>]]
If export_filename is not set, then generators fall back to the previos
behavior and use the export_name as the export filename base, the file
will be generated unconditionally. If export_filename is set and the
follow boolean flag is not set or is set to false, generators skip the
generating of the export file.
[ChangeLog][Protobuf][qtprotobufgen] EXPORT_MACRO option now has the
following format:
EXPORT_MACRO=<export_name>[:export_filename[:<true|false>]]
New option extras allow setting the generated export filename and
control if it should be generated at the generator run.
[ChangeLog][GRPC][qtgrpcgen] EXPORT_MACRO option now has the
following format:
EXPORT_MACRO=<export_name>[:export_filename[:<true|false>]]
New option extras allow setting the generated export filename and
control if it should be generated at the generator run.
Pick-to: 6.7
Fixes: QTBUG-121854
Change-Id: Ifff6506ab363d18dc417f222e9929d7eba135d8a
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We should enable AUTOMOC for all types of targets support by modules.
The current condition breaks executables and modules(plugins).
Pick-to: 6.7 6.6 6.5
Change-Id: I4c078d4dbadbbb26b2eb393da729a4d2c808de1b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
BUILD_SHARED_LIBS cmake flag usually indicates the type of library
that will be created by the cmake add_library call. This solution
doesn't work with _qt_internal_add_library since the logic of library
creation differs there.
Instead of predicting, let's rely on creation result.
Pick-to: 6.6 6.5
Change-Id: Ie983b30377f1e0f3f42fdbb1a6dc8ec340770ee5
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Fix the function arguments processing. Both generated_files and
generation_options were visible because of scope visibility and
were not processed by _qt_internal_protoc_generate correctly.
Fix this by using and processing arguments the proper way.
Pick-to: 6.5
Change-Id: I1eaad92cecfd9d8b415ec2d06cb947979d6baba6
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Handle MODULE_LIBRARY target type in the qt6_add_grpc() CMake method.
The same behavior exists in the qt6_add_protobuf() and it seems missing
int the GRPC counterpart.
It fixed calls to the method in the Android environment, for example
building GRPC examples.
Pick-to: 6.5 6.5.0
Change-Id: I947587f8942dcfcced62029e39b3385e842d7933
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This should be done by the qt_add_protobuf/grpc functions caller
instead. Otherwise this could break exising deployment rules, like it
happens for qt protobuf modules.
Amends 326ebfaadb
Pick-to: 6.5
Change-Id: I79e562cf1a0041b4bf7fc550b69dfa7fa41cb862
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>