Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cmake add separate export for plugin targets #31525

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 11 additions & 7 deletions CMakeLists.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions cmake/gRPCConfig.cmake.in
Expand Up @@ -11,3 +11,6 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules)

# Targets
include(${CMAKE_CURRENT_LIST_DIR}/gRPCTargets.cmake)
if(NOT CMAKE_CROSSCOMPILING)
include(${CMAKE_CURRENT_LIST_DIR}/gRPCPluginTargets.cmake)
endif()
8 changes: 8 additions & 0 deletions templates/CMakeLists.txt.template
Expand Up @@ -800,7 +800,11 @@
% else:
if(gRPC_INSTALL)
% endif
% if tgt.build == 'protoc' and 'grpc_plugin_support' in tgt.get('deps', []):
install(TARGETS ${tgt.name} EXPORT gRPCPluginTargets
% else:
install(TARGETS ${tgt.name} EXPORT gRPCTargets
% endif
RUNTIME DESTINATION <%text>${gRPC_INSTALL_BINDIR}</%text>
BUNDLE DESTINATION <%text>${gRPC_INSTALL_BINDIR}</%text>
LIBRARY DESTINATION <%text>${gRPC_INSTALL_LIBDIR}</%text>
Expand All @@ -814,6 +818,10 @@
DESTINATION <%text>${gRPC_INSTALL_CMAKEDIR}</%text>
NAMESPACE gRPC::
)
install(EXPORT gRPCPluginTargets
DESTINATION <%text>${gRPC_INSTALL_CMAKEDIR}</%text>
NAMESPACE gRPC::
)
endif()

include(CMakePackageConfigHelpers)
Expand Down