| 1 |
# Copyright (C) 2024 The Qt Company Ltd. |
| 2 |
# SPDX-License-Identifier: BSD-3-Clause |
| 3 |
|
| 4 |
set(proto_out_dir "${CMAKE_CURRENT_BINARY_DIR}/include/proto/") |
| 5 |
set(proto_out_include "${CMAKE_CURRENT_BINARY_DIR}/include/") |
| 6 |
|
| 7 |
if (NOT TARGET Qt6::Grpc) |
| 8 |
message(WARNING "Dependencies of QtGrpc bench_qtgrpcclient not found. Skipping.") |
| 9 |
return() |
| 10 |
endif() |
| 11 |
|
| 12 |
qt_internal_add_executable( |
| 13 |
bench_qtgrpcclient |
| 14 |
SOURCES |
| 15 |
bench_qtgrpcclient.cpp |
| 16 |
LIBRARIES |
| 17 |
Qt::Grpc |
| 18 |
Qt::ProtobufWellKnownTypes |
| 19 |
INCLUDE_DIRECTORIES |
| 20 |
"${proto_out_include}" |
| 21 |
"${qrpcbench_common_include}" |
| 22 |
OUTPUT_DIRECTORY |
| 23 |
"${CMAKE_CURRENT_BINARY_DIR}" |
| 24 |
) |
| 25 |
|
| 26 |
qt_add_protobuf(bench_qtgrpcclient |
| 27 |
PROTO_FILES |
| 28 |
"${proto_path}" |
| 29 |
OUTPUT_DIRECTORY |
| 30 |
"${proto_out_dir}" |
| 31 |
PROTO_INCLUDES |
| 32 |
$<TARGET_PROPERTY:Qt6::ProtobufWellKnownTypes,QT_PROTO_INCLUDES> |
| 33 |
) |
| 34 |
|
| 35 |
qt_add_grpc(bench_qtgrpcclient CLIENT |
| 36 |
PROTO_FILES |
| 37 |
"${proto_path}" |
| 38 |
OUTPUT_DIRECTORY |
| 39 |
"${proto_out_dir}" |
| 40 |
PROTO_INCLUDES |
| 41 |
$<TARGET_PROPERTY:Qt6::ProtobufWellKnownTypes,QT_PROTO_INCLUDES> |
| 42 |
) |
| 43 |
|
| 44 |
target_compile_definitions(bench_qtgrpcclient PRIVATE QTGRPCCLIENT) |
| 45 |
|
| 46 |
if(TARGET asyncbenchserver) |
| 47 |
add_dependencies(bench_qtgrpcclient asyncbenchserver) |
| 48 |
endif() |