From ecc457b43fc864d84e8555705db978c2c1bbc339 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 7 Apr 2017 14:06:16 +0200 Subject: [PATCH] allow using gRPC as a cmake subproject --- CMakeLists.txt | 7 ++----- templates/CMakeLists.txt.template | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 96ece1fd600..f8b88645cb1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,9 +5,6 @@ # This file can be regenerated from the template by running # tools/buildgen/generate_projects.sh # -# Additionally, this is currently very experimental, and unsupported. -# Further work will happen on that file. -# # Copyright 2015, Google Inc. # All rights reserved. # @@ -308,7 +305,7 @@ function(protobuf_generate_grpc_cpp) foreach(FIL ${ARGN}) get_filename_component(ABS_FIL ${FIL} ABSOLUTE) get_filename_component(FIL_WE ${FIL} NAME_WE) - file(RELATIVE_PATH REL_FIL ${CMAKE_SOURCE_DIR} ${ABS_FIL}) + file(RELATIVE_PATH REL_FIL ${CMAKE_CURRENT_SOURCE_DIR} ${ABS_FIL}) get_filename_component(REL_DIR ${REL_FIL} DIRECTORY) set(RELFIL_WE "${REL_DIR}/${FIL_WE}") @@ -324,7 +321,7 @@ function(protobuf_generate_grpc_cpp) ${_protobuf_include_path} ${REL_FIL} DEPENDS ${ABS_FIL} ${_gRPC_PROTOBUF_PROTOC} grpc_cpp_plugin - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Running gRPC C++ protocol buffer compiler on ${FIL}" VERBATIM) diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template index e2fc216bca7..1a41d807e97 100644 --- a/templates/CMakeLists.txt.template +++ b/templates/CMakeLists.txt.template @@ -7,9 +7,6 @@ # This file can be regenerated from the template by running # tools/buildgen/generate_projects.sh # - # Additionally, this is currently very experimental, and unsupported. - # Further work will happen on that file. - # # Copyright 2015, Google Inc. # All rights reserved. # @@ -353,7 +350,7 @@ foreach(FIL <%text>${ARGN}) get_filename_component(ABS_FIL <%text>${FIL} ABSOLUTE) get_filename_component(FIL_WE <%text>${FIL} NAME_WE) - file(RELATIVE_PATH REL_FIL <%text>${CMAKE_SOURCE_DIR} <%text>${ABS_FIL}) + file(RELATIVE_PATH REL_FIL <%text>${CMAKE_CURRENT_SOURCE_DIR} <%text>${ABS_FIL}) get_filename_component(REL_DIR <%text>${REL_FIL} DIRECTORY) set(RELFIL_WE "<%text>${REL_DIR}/${FIL_WE}") @@ -369,7 +366,7 @@ <%text>${_protobuf_include_path} <%text>${REL_FIL} DEPENDS <%text>${ABS_FIL} <%text>${_gRPC_PROTOBUF_PROTOC} grpc_cpp_plugin - WORKING_DIRECTORY <%text>${CMAKE_SOURCE_DIR} + WORKING_DIRECTORY <%text>${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Running gRPC C++ protocol buffer compiler on <%text>${FIL}" VERBATIM)