2019-01-08 15:42:41 -05:00
|
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
|
|
|
|
2018-04-02 23:29:14 -04:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2019-06-05 19:38:37 -04:00
|
|
|
REPO googleapis/google-cloud-cpp
|
2023-07-01 08:34:48 +08:00
|
|
|
REF "v${VERSION}"
|
2024-09-09 23:28:35 -04:00
|
|
|
SHA512 0ea58e933f5b57cd7c734c8139c3e334d1427a255b918cbabb35d909e9b5faf8a89bf174cff55468ea97ab7f472d96236c573093fc279fdccb0af64747f2af3a
|
2021-10-01 19:59:54 -04:00
|
|
|
HEAD_REF main
|
2018-04-02 23:29:14 -04:00
|
|
|
)
|
|
|
|
|
2023-10-19 21:55:20 +03:00
|
|
|
if ("grpc-common" IN_LIST FEATURES)
|
|
|
|
vcpkg_add_to_path(PREPEND "${CURRENT_HOST_INSTALLED_DIR}/tools/grpc")
|
|
|
|
endif ()
|
2021-03-26 12:55:34 -07:00
|
|
|
|
2021-08-30 17:14:50 -07:00
|
|
|
set(GOOGLE_CLOUD_CPP_ENABLE "${FEATURES}")
|
|
|
|
list(REMOVE_ITEM GOOGLE_CLOUD_CPP_ENABLE "core")
|
2023-08-02 16:05:37 +00:00
|
|
|
# This feature does not exist, but allows us to simplify the vcpkg.json
|
|
|
|
# file.
|
2022-03-16 16:53:57 -04:00
|
|
|
list(REMOVE_ITEM GOOGLE_CLOUD_CPP_ENABLE "grpc-common")
|
2023-08-02 16:05:37 +00:00
|
|
|
list(REMOVE_ITEM GOOGLE_CLOUD_CPP_ENABLE "rest-common")
|
2021-08-30 17:14:50 -07:00
|
|
|
list(REMOVE_ITEM GOOGLE_CLOUD_CPP_ENABLE "googleapis")
|
2022-06-23 12:58:17 -07:00
|
|
|
# google-cloud-cpp uses dialogflow_cx and dialogflow_es. Underscores
|
|
|
|
# are invalid in `vcpkg` features, we use dashes (`-`) as a separator
|
|
|
|
# for the `vcpkg` feature name, and convert it here to something that
|
|
|
|
# `google-cloud-cpp` would like.
|
2022-08-22 09:29:53 -07:00
|
|
|
if ("dialogflow-cx" IN_LIST FEATURES)
|
2022-06-23 12:58:17 -07:00
|
|
|
list(REMOVE_ITEM GOOGLE_CLOUD_CPP_ENABLE "dialogflow-cx")
|
|
|
|
list(APPEND GOOGLE_CLOUD_CPP_ENABLE "dialogflow_cx")
|
|
|
|
endif ()
|
2022-08-22 09:29:53 -07:00
|
|
|
if ("dialogflow-es" IN_LIST FEATURES)
|
2022-06-23 12:58:17 -07:00
|
|
|
list(REMOVE_ITEM GOOGLE_CLOUD_CPP_ENABLE "dialogflow-es")
|
|
|
|
list(APPEND GOOGLE_CLOUD_CPP_ENABLE "dialogflow_es")
|
|
|
|
endif ()
|
2024-03-22 23:56:39 +00:00
|
|
|
if ("experimental-storage-grpc" IN_LIST FEATURES)
|
|
|
|
list(REMOVE_ITEM GOOGLE_CLOUD_CPP_ENABLE "experimental-storage-grpc")
|
|
|
|
list(APPEND GOOGLE_CLOUD_CPP_ENABLE "experimental-storage_grpc")
|
|
|
|
endif ()
|
2021-08-30 17:14:50 -07:00
|
|
|
|
2021-10-01 19:59:54 -04:00
|
|
|
vcpkg_cmake_configure(
|
2022-08-22 09:29:53 -07:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2019-08-07 19:43:35 -04:00
|
|
|
DISABLE_PARALLEL_CONFIGURE
|
2018-04-02 23:29:14 -04:00
|
|
|
OPTIONS
|
2021-08-30 17:14:50 -07:00
|
|
|
"-DGOOGLE_CLOUD_CPP_ENABLE=${GOOGLE_CLOUD_CPP_ENABLE}"
|
2018-11-14 18:20:54 -05:00
|
|
|
-DGOOGLE_CLOUD_CPP_ENABLE_MACOS_OPENSSL_CHECK=OFF
|
2020-06-03 01:46:06 -04:00
|
|
|
-DGOOGLE_CLOUD_CPP_ENABLE_WERROR=OFF
|
2021-03-26 12:55:34 -07:00
|
|
|
-DGOOGLE_CLOUD_CPP_ENABLE_CCACHE=OFF
|
2021-06-04 19:50:36 -04:00
|
|
|
-DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES=OFF
|
2019-11-19 18:57:48 -05:00
|
|
|
-DBUILD_TESTING=OFF
|
2024-07-10 17:14:13 +03:00
|
|
|
-DGOOGLE_CLOUD_CPP_WITH_MOCKS=OFF
|
2018-04-02 23:29:14 -04:00
|
|
|
)
|
|
|
|
|
2021-10-01 19:59:54 -04:00
|
|
|
vcpkg_cmake_install()
|
2018-04-02 23:29:14 -04:00
|
|
|
|
2022-08-22 09:29:53 -07:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
2024-02-02 21:39:16 +00:00
|
|
|
|
|
|
|
function (google_cloud_cpp_cmake_config_fixup library)
|
2024-04-29 13:09:04 +00:00
|
|
|
string(REPLACE "experimental-" "" library "${library}")
|
|
|
|
string(REPLACE "-" "_" library "${library}")
|
2024-02-02 21:39:16 +00:00
|
|
|
set(config_path "lib/cmake/google_cloud_cpp_${library}")
|
|
|
|
# If the library exists and is installed, tell vcpkg about it.
|
2021-10-05 19:03:03 -04:00
|
|
|
if(NOT IS_DIRECTORY "${CURRENT_PACKAGES_DIR}/${config_path}")
|
2024-02-02 21:39:16 +00:00
|
|
|
return()
|
2021-10-05 19:03:03 -04:00
|
|
|
endif()
|
2024-02-02 21:39:16 +00:00
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME "google_cloud_cpp_${library}"
|
2021-10-05 19:03:03 -04:00
|
|
|
CONFIG_PATH "${config_path}"
|
|
|
|
DO_NOT_DELETE_PARENT_CONFIG_PATH)
|
2024-02-02 21:39:16 +00:00
|
|
|
endfunction ()
|
|
|
|
|
|
|
|
foreach(feature IN LISTS GOOGLE_CLOUD_CPP_ENABLE)
|
|
|
|
google_cloud_cpp_cmake_config_fixup(${feature})
|
|
|
|
google_cloud_cpp_cmake_config_fixup(${feature}_mocks)
|
2021-10-05 19:03:03 -04:00
|
|
|
endforeach()
|
2024-02-02 21:39:16 +00:00
|
|
|
|
2021-10-05 19:03:03 -04:00
|
|
|
# These packages are automatically installed depending on what features are
|
|
|
|
# enabled.
|
2024-02-02 21:39:16 +00:00
|
|
|
foreach(feature common compute_protos googleapis grpc_utils iam_v2 logging_type rest_internal rest_protobuf_internal)
|
|
|
|
google_cloud_cpp_cmake_config_fixup(${feature})
|
2021-10-05 19:03:03 -04:00
|
|
|
endforeach()
|
2018-04-02 23:29:14 -04:00
|
|
|
|
2021-10-05 19:03:03 -04:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/cmake"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/lib/cmake"
|
2022-01-19 19:48:18 +01:00
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/share")
|
2022-08-22 09:29:53 -07:00
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
2018-04-02 23:29:14 -04:00
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|