aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/CMakeLists.txt.template5
1 files changed, 3 insertions, 2 deletions
diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template
index c792877b04..0719b3688f 100644
--- a/templates/CMakeLists.txt.template
+++ b/templates/CMakeLists.txt.template
@@ -93,8 +93,9 @@
option(gRPC_BUILD_TESTS "Build tests" OFF)
set(gRPC_INSTALL_default ON)
- if (MSVC)
- set(gRPC_INSTALL_default OFF)
+ if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+ # Disable gRPC_INSTALL by default if building as a submodule
+ set(gRPC_INSTALL_default OFF)
endif()
set(gRPC_INSTALL <%text>${gRPC_INSTALL_default}</%text> CACHE BOOL
"Generate installation target: gRPC_ZLIB_PROVIDER, gRPC_CARES_PROVIDER, gRPC_SSL_PROVIDER and gRPC_PROTOBUF_PROVIDER must all be \"package\"")