aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates
diff options
context:
space:
mode:
authorGravatar Alex Merry <alex.merry@kde.org>2017-05-15 22:59:37 +0100
committerGravatar Alex Merry <alex.merry@kde.org>2017-05-15 22:59:37 +0100
commita65f006d2111b2d94d5108ac4fca7f29f75c81b1 (patch)
treed5ee9baaa288e53217cbd1561d65ac5104ad504a /templates
parentc17eb5c37e1c2ab44bb1e001769379e5c6f58f64 (diff)
Set gRPC_INSTALL to ON by default for MSVC and OFF if a subproject
Now that gRPC_INSTALL is forced off if using bundled third-party libraries, it no longer makes sense to set it OFF by default for MSVC. However, we do want to set it OFF by default if gRPC is being built as a subproject of another project.
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\"")