[grpc] Fix absolute paths in installed cmake files.

This commit is contained in:
Robert Schumacher 2017-10-19 08:53:59 -07:00
parent 0b75d75f55
commit f527812e9e
3 changed files with 8 additions and 3 deletions

View File

@ -1,4 +1,4 @@
Source: grpc
Version: 1.6.0-1
Version: 1.6.0-2
Build-Depends: zlib, openssl, protobuf, c-ares
Description: An RPC library and framework

View File

@ -52,14 +52,17 @@ vcpkg_configure_cmake(
-DgRPC_GFLAGS_PROVIDER=none
-DgRPC_BENCHMARK_PROVIDER=none
-DgRPC_INSTALL_CSHARP_EXT=OFF
-DCMAKE_INSTALL_CMAKEDIR=share/grpc
-DgRPC_INSTALL_BINDIR:STRING=bin
-DgRPC_INSTALL_LIBDIR:STRING=lib
-DgRPC_INSTALL_INCLUDEDIR:STRING=include
-DgRPC_INSTALL_CMAKEDIR:STRING=share/grpc
)
# gRPC runs built executables during the build, so they need access to the installed DLLs.
set(ENV{PATH} "$ENV{PATH};${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/debug/bin")
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/grpc")
vcpkg_fixup_cmake_targets(CONFIG_PATH "share/grpc")
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/grpc RENAME copyright)

View File

@ -83,6 +83,7 @@ function(vcpkg_fixup_cmake_targets)
)
foreach(RELEASE_TARGET ${RELEASE_TARGETS})
file(READ ${RELEASE_TARGET} _contents)
string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" _contents "${_contents}")
string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \"]+\\.exe)" "\${_IMPORT_PREFIX}/tools/${PORT}/\\1" _contents "${_contents}")
file(WRITE ${RELEASE_TARGET} "${_contents}")
endforeach()
@ -95,6 +96,7 @@ function(vcpkg_fixup_cmake_targets)
get_filename_component(DEBUG_TARGET_NAME ${DEBUG_TARGET} NAME)
file(READ ${DEBUG_TARGET} _contents)
string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" _contents "${_contents}")
string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \"]+\\.exe)" "\${_IMPORT_PREFIX}/tools/${PORT}/\\1" _contents "${_contents}")
string(REPLACE "\${_IMPORT_PREFIX}/lib" "\${_IMPORT_PREFIX}/debug/lib" _contents "${_contents}")
string(REPLACE "\${_IMPORT_PREFIX}/bin" "\${_IMPORT_PREFIX}/debug/bin" _contents "${_contents}")