Add BUILD_BYPRODUCTS (#9)

This commit is contained in:
Takashi Matsuo 2019-07-18 14:33:32 -04:00 committed by GitHub
parent 763c731470
commit 8c2add05fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -44,8 +44,12 @@ set(
set(GOOGLE_CLOUD_CPP_GOOGLEAPIS_SHA256 set(GOOGLE_CLOUD_CPP_GOOGLEAPIS_SHA256
"6b8a9b2bcb4476e9a5a9872869996f0d639c8d5df76dd8a893e79201f211b1cf") "6b8a9b2bcb4476e9a5a9872869996f0d639c8d5df76dd8a893e79201f211b1cf")
set(GOOGLEAPIS_CPP_SOURCE
"${CMAKE_BINARY_DIR}/external/googleapis/src/googleapis_download")
include(ExternalProject) include(ExternalProject)
ExternalProject_Add(googleapis_download ExternalProject_Add(
googleapis_download
EXCLUDE_FROM_ALL ON EXCLUDE_FROM_ALL ON
PREFIX "${CMAKE_BINARY_DIR}/external/googleapis" PREFIX "${CMAKE_BINARY_DIR}/external/googleapis"
URL ${GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL} URL ${GOOGLE_CLOUD_CPP_GOOGLEAPIS_URL}
@ -53,9 +57,34 @@ ExternalProject_Add(googleapis_download
CONFIGURE_COMMAND "" CONFIGURE_COMMAND ""
BUILD_COMMAND "" BUILD_COMMAND ""
INSTALL_COMMAND "" INSTALL_COMMAND ""
BUILD_BYPRODUCTS
"${GOOGLEAPIS_CPP_SOURCE}/google/api/http.proto"
"${GOOGLEAPIS_CPP_SOURCE}/google/api/annotations.proto"
"${GOOGLEAPIS_CPP_SOURCE}/google/api/auth.proto"
"${GOOGLEAPIS_CPP_SOURCE}/google/api/resource.proto"
"${GOOGLEAPIS_CPP_SOURCE}/google/type/expr.proto"
"${GOOGLEAPIS_CPP_SOURCE}/google/rpc/error_details.proto"
"${GOOGLEAPIS_CPP_SOURCE}/google/rpc/status.proto"
"${GOOGLEAPIS_CPP_SOURCE}/google/iam/v1/policy.proto"
"${GOOGLEAPIS_CPP_SOURCE}/google/iam/v1/iam_policy.proto"
"${GOOGLEAPIS_CPP_SOURCE}/google/longrunning/operations.proto"
"${GOOGLEAPIS_CPP_SOURCE}/google/bigtable/admin/v2/bigtable_instance_admin.proto"
"${GOOGLEAPIS_CPP_SOURCE}/google/bigtable/admin/v2/bigtable_table_admin.proto"
"${GOOGLEAPIS_CPP_SOURCE}/google/bigtable/admin/v2/common.proto"
"${GOOGLEAPIS_CPP_SOURCE}/google/bigtable/admin/v2/instance.proto"
"${GOOGLEAPIS_CPP_SOURCE}/google/bigtable/admin/v2/table.proto"
"${GOOGLEAPIS_CPP_SOURCE}/google/bigtable/v2/bigtable.proto"
"${GOOGLEAPIS_CPP_SOURCE}/google/bigtable/v2/data.proto"
"${GOOGLEAPIS_CPP_SOURCE}/google/spanner/admin/database/v1/spanner_database_admin.proto"
"${GOOGLEAPIS_CPP_SOURCE}/google/spanner/admin/instance/v1/spanner_instance_admin.proto"
"${GOOGLEAPIS_CPP_SOURCE}/google/spanner/v1/keys.proto"
"${GOOGLEAPIS_CPP_SOURCE}/google/spanner/v1/mutation.proto"
"${GOOGLEAPIS_CPP_SOURCE}/google/spanner/v1/query_plan.proto"
"${GOOGLEAPIS_CPP_SOURCE}/google/spanner/v1/result_set.proto"
"${GOOGLEAPIS_CPP_SOURCE}/google/spanner/v1/spanner.proto"
"${GOOGLEAPIS_CPP_SOURCE}/google/spanner/v1/transaction.proto"
"${GOOGLEAPIS_CPP_SOURCE}/google/spanner/v1/type.proto"
LOG_DOWNLOAD OFF) LOG_DOWNLOAD OFF)
ExternalProject_Get_Property(googleapis_download SOURCE_DIR)
set(GOOGLEAPIS_CPP_SOURCE "${SOURCE_DIR}")
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
find_package(ProtobufTargets REQUIRED) find_package(ProtobufTargets REQUIRED)