include(CMakeFindDependencyMacro)

set(_save_cmake_module_path "${CMAKE_MODULE_PATH}")
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
find_dependency(WrapProtobuf COMPONENTS Protobuf REQUIRED)
set(CMAKE_MODULE_PATH "${_save_cmake_module_path}")

if(NOT TARGET @QT_PROTOBUF_NAMESPACE@::@target@)
    include("${CMAKE_CURRENT_LIST_DIR}/@target_export@.cmake")
endif()

# Make possible usage of
# $<TARGET_PROPERTY:${QT_PROTOBUF_NAMESPACE}::ProtobufWellKnownTypes,PROTO_INCLUDES>
# outside the build tree. Expecting that WrapProtobuf sets Protobuf_INCLUDE_DIRS.

string(JOIN " -I" proto_includes ${Protobuf_INCLUDE_DIRS})

set_target_properties(@QT_PROTOBUF_NAMESPACE@::@target@ PROPERTIES
    PROTO_INCLUDES "-I${proto_includes}"
)

@PACKAGE_INIT@
