Revision control

Copy as Markdown

# Copyright (C) 2025 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
if(__qt_@target@_targets_file_included)
get_target_property(_@target@_protobuf_wellknowntypes @QT_CMAKE_EXPORT_NAMESPACE@::@target@
_qt_internal_protobuf_wellknown_types)
set(_@target@_proto_external_include_dirs "")
set(_@target@_types_not_found "")
set(_@target@_include_lookup_dirs
"${protobuf_ROOT}"
"${Protobuf_ROOT}"
"$ENV{protobuf_ROOT}"
"$ENV{Protobuf_ROOT}"
)
foreach(extra_protobuf_dir_path "${protobuf_DIR}" "${Protobuf_DIR}" "$ENV{protobuf_DIR}"
"$ENV{Protobuf_DIR}")
if(extra_protobuf_dir_path)
list(APPEND _@target@_include_lookup_dirs
"${extra_protobuf_dir_path}/../../.."
"${extra_protobuf_dir_path}/../.."
"${extra_protobuf_dir_path}"
)
endif()
unset(extra_protobuf_dir_path)
endforeach()
set(_@target@_extra_find_path_args "")
if(CMAKE_CROSSCOMPILING)
# NO_DEFAULT_PATH is intentionally omitted: the consumer's CMAKE_PREFIX_PATH
# may point to the target protobuf prefix where the .proto files live, and
# that path must remain searchable. Unlike BuildInternals, there is no
# protobuf::libprotobuf target to fall back on here.
set(_@target@_extra_find_path_args CMAKE_FIND_ROOT_PATH_BOTH)
endif()
foreach(type IN LISTS _@target@_protobuf_wellknowntypes)
unset(_@target@_proto_file_dir)
find_path(_@target@_proto_file_dir
NAMES "${type}"
PATHS ${_@target@_include_lookup_dirs}
PATH_SUFFIXES include
NO_CACHE
${_@target@_extra_find_path_args}
)
if(_@target@_proto_file_dir)
if(NOT _@target@_proto_file_dir IN_LIST _@target@_proto_external_include_dirs)
list(APPEND _@target@_proto_external_include_dirs "${_@target@_proto_file_dir}")
endif()
else()
list(APPEND _@target@_types_not_found "${type}")
endif()
endforeach()
unset(type)
if(NOT _@target@_types_not_found)
include(
"${CMAKE_CURRENT_LIST_DIR}/@QT_CMAKE_EXPORT_NAMESPACE@@target@ProtobufProperties.cmake")
else()
set(@INSTALL_CMAKE_NAMESPACE@@target@_FOUND FALSE)
list(JOIN _@target@_types_not_found "\n " _@target@_types_not_found_string)
string(JOIN "" @INSTALL_CMAKE_NAMESPACE@@target@_NOT_FOUND_MESSAGE
"@INSTALL_CMAKE_NAMESPACE@@target@ lacks the following protobuf schemas:"
"\n ${_@target@_types_not_found_string}\n"
"Please check your protobuf installation and ensure the missing schemas are in the"
" CMake find paths. If you use a custom protobuf installation point to its location"
" in protobuf_ROOT, Protobuf_ROOT, protobuf_DIR or Protobuf_DIR environment or"
" cache variables.")
unset(_@target@_types_not_found_string)
endif()
unset(_@target@_include_lookup_dirs)
unset(_@target@_types_not_found)
unset(_@target@_proto_external_include_dirs)
unset(_@target@_protobuf_wellknowntypes)
endif()