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.
pull/11140/head
Alex Merry 8 years ago
parent c17eb5c37e
commit a65f006d21
  1. 3
      CMakeLists.txt
  2. 3
      templates/CMakeLists.txt.template

@ -49,7 +49,8 @@ project(${PACKAGE_NAME} C CXX)
option(gRPC_BUILD_TESTS "Build tests" OFF) option(gRPC_BUILD_TESTS "Build tests" OFF)
set(gRPC_INSTALL_default ON) set(gRPC_INSTALL_default ON)
if (MSVC) 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) set(gRPC_INSTALL_default OFF)
endif() endif()
set(gRPC_INSTALL ${gRPC_INSTALL_default} CACHE BOOL set(gRPC_INSTALL ${gRPC_INSTALL_default} CACHE BOOL

@ -93,7 +93,8 @@
option(gRPC_BUILD_TESTS "Build tests" OFF) option(gRPC_BUILD_TESTS "Build tests" OFF)
set(gRPC_INSTALL_default ON) set(gRPC_INSTALL_default ON)
if (MSVC) 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) set(gRPC_INSTALL_default OFF)
endif() endif()
set(gRPC_INSTALL <%text>${gRPC_INSTALL_default}</%text> CACHE BOOL set(gRPC_INSTALL <%text>${gRPC_INSTALL_default}</%text> CACHE BOOL

Loading…
Cancel
Save