vcpkg/ports/grpc/portfile.cmake
2017-05-06 23:04:32 -07:00

52 lines
1.5 KiB
CMake

if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
message(STATUS "Warning: Dynamic building not supported yet. Building static.")
set(VCPKG_LIBRARY_LINKAGE static)
endif()
include(vcpkg_common_functions)
if(EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git")
file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/src)
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO grpc/grpc
REF v1.2.3
SHA512 51e3c2f866fcac861ca007dd022373e63f82c63754001d1182ea14dd2eff2dfba325f8bc130ddf94e4ae35e23299ca337a6c5c6a9cee145f9e5c79e4c46af280
HEAD_REF master
)
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES ${CMAKE_CURRENT_LIST_DIR}/revert-c019e05.patch
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DgRPC_INSTALL=ON
-DgRPC_ZLIB_PROVIDER=package
-DgRPC_SSL_PROVIDER=package
-DgRPC_PROTOBUF_PROVIDER=package
-DCMAKE_INSTALL_CMAKEDIR=share/grpc
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets()
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/grpc RENAME copyright)
# Install tools and plugins
file(GLOB TOOLS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.exe")
if(TOOLS)
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/grpc)
file(COPY ${TOOLS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/grpc)
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
vcpkg_copy_pdbs()