2017-01-14 02:55:04 +01:00
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
|
|
|
message(STATUS "Warning: Dynamic building not supported yet. Building static.")
|
|
|
|
set(VCPKG_LIBRARY_LINKAGE static)
|
2016-10-26 15:26:56 -07:00
|
|
|
endif()
|
2016-09-23 18:10:50 +03:00
|
|
|
include(vcpkg_common_functions)
|
|
|
|
|
2017-04-21 17:05:43 -07:00
|
|
|
set(GRPC_VERSION 1.2.3)
|
2017-04-18 17:29:24 -07:00
|
|
|
|
|
|
|
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/grpc-${GRPC_VERSION})
|
2016-09-23 18:10:50 +03:00
|
|
|
|
2017-02-17 01:18:32 -08:00
|
|
|
if(EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git")
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/src)
|
2016-09-23 18:10:50 +03:00
|
|
|
endif()
|
|
|
|
|
2017-02-17 01:18:32 -08:00
|
|
|
vcpkg_download_distfile(ARCHIVE_FILE
|
2017-04-18 17:29:24 -07:00
|
|
|
URLS "https://github.com/grpc/grpc/archive/v${GRPC_VERSION}.zip"
|
|
|
|
FILENAME "grpc-v${GRPC_VERSION}.tar.gz"
|
2017-04-21 17:05:43 -07:00
|
|
|
SHA512 1468ace60ce9affb563b8145d43793778786626bfd568c79ba9c9792bf05adb86e99dfd13ff21c4b723909fbddae583148201be1a694bc0960fbe10200f52544
|
2017-02-17 01:18:32 -08:00
|
|
|
)
|
|
|
|
vcpkg_extract_source_archive(${ARCHIVE_FILE})
|
|
|
|
|
|
|
|
vcpkg_apply_patches(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2017-04-21 17:05:43 -07:00
|
|
|
PATCHES ${CMAKE_CURRENT_LIST_DIR}/revert-c019e05.patch
|
2017-02-17 01:18:32 -08:00
|
|
|
)
|
2016-09-23 18:10:50 +03:00
|
|
|
|
|
|
|
vcpkg_configure_cmake(
|
2017-02-17 01:18:32 -08:00
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2017-04-21 17:05:43 -07:00
|
|
|
PREFER_NINJA
|
2016-09-23 18:10:50 +03:00
|
|
|
OPTIONS
|
|
|
|
-DgRPC_INSTALL=ON
|
|
|
|
-DgRPC_ZLIB_PROVIDER=package
|
|
|
|
-DgRPC_SSL_PROVIDER=package
|
|
|
|
-DgRPC_PROTOBUF_PROVIDER=package
|
2017-04-21 17:05:43 -07:00
|
|
|
-DCMAKE_INSTALL_CMAKEDIR=share/grpc
|
2016-09-23 18:10:50 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
2017-02-07 15:30:19 -05:00
|
|
|
# Update paths in gRPCTargets-release.cmake
|
2017-04-21 17:05:43 -07:00
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCTargets-release.cmake _contents)
|
2017-02-07 15:30:19 -05:00
|
|
|
string(REPLACE "\${_IMPORT_PREFIX}/bin/" "\${_IMPORT_PREFIX}/tools/" _contents "${_contents}")
|
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCTargets-release.cmake "${_contents}")
|
|
|
|
|
|
|
|
# Update paths in gRPCTargets-debug.cmake
|
2017-04-21 17:05:43 -07:00
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/debug/share/grpc/gRPCTargets-debug.cmake _contents)
|
2017-02-07 15:30:19 -05:00
|
|
|
string(REPLACE "\${_IMPORT_PREFIX}/bin/" "\${_IMPORT_PREFIX}/tools/" _contents "${_contents}")
|
|
|
|
string(REPLACE "\${_IMPORT_PREFIX}/lib/" "\${_IMPORT_PREFIX}/debug/lib/" _contents "${_contents}")
|
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCTargets-debug.cmake "${_contents}")
|
2016-09-23 18:10:50 +03:00
|
|
|
|
2017-02-17 01:18:32 -08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/grpc RENAME copyright)
|
2017-02-01 12:49:09 -05:00
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools)
|
2016-09-23 18:10:50 +03:00
|
|
|
|
2017-02-07 15:30:19 -05:00
|
|
|
# Install tools and plugins
|
2017-04-21 17:05:43 -07:00
|
|
|
file(GLOB TOOLS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.exe")
|
|
|
|
if(TOOLS)
|
|
|
|
file(COPY ${TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools)
|
|
|
|
endif()
|
2017-02-07 15:30:19 -05:00
|
|
|
|
2016-09-23 18:10:50 +03:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
|
2017-01-14 02:55:04 +01:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
|
2017-04-21 17:05:43 -07:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
|
2016-09-23 18:10:50 +03:00
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|