diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-02-09 00:04:44 -0800 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2017-02-09 00:04:44 -0800 |
| commit | 678f7faf0bb0f39fce56b375010e2ef07cbebbdb (patch) | |
| tree | b0ea010ea8e7696b928c5d5cac769043a64f249e | |
| parent | 135138391e2767e21f8b681f1ed5539ac79687e4 (diff) | |
| parent | 47109bb96aa257f300b142e4d0ac6e115ec5150f (diff) | |
| download | vcpkg-678f7faf0bb0f39fce56b375010e2ef07cbebbdb.tar.gz vcpkg-678f7faf0bb0f39fce56b375010e2ef07cbebbdb.zip | |
Merge pull request #639 from msmolens/fix-grpc-exported-targets
[grpc] Fix exported targets
| -rw-r--r-- | ports/grpc/CONTROL | 2 | ||||
| -rw-r--r-- | ports/grpc/portfile.cmake | 27 |
2 files changed, 25 insertions, 4 deletions
diff --git a/ports/grpc/CONTROL b/ports/grpc/CONTROL index b9d19da4c..3de78c477 100644 --- a/ports/grpc/CONTROL +++ b/ports/grpc/CONTROL @@ -1,4 +1,4 @@ Source: grpc -Version: 1.1.0-dev-1674f65-1 +Version: 1.1.0-dev-1674f65-2 Build-Depends: zlib, openssl, protobuf Description: An RPC library and framework
\ No newline at end of file diff --git a/ports/grpc/portfile.cmake b/ports/grpc/portfile.cmake index 90915976c..ba511a004 100644 --- a/ports/grpc/portfile.cmake +++ b/ports/grpc/portfile.cmake @@ -48,14 +48,35 @@ vcpkg_install_cmake() file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/grpc) file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake/gRPC/gRPCConfig.cmake ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCConfig.cmake) file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake/gRPC/gRPCConfigVersion.cmake ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCConfigVersion.cmake) -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake/gRPC/gRPCTargets.cmake ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCTargets.cmake) -file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake/gRPC/gRPCTargets-release.cmake ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCTargets-release.cmake) -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/cmake/gRPC/gRPCTargets-debug.cmake ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCTargets-debug.cmake) + +# Update import target prefix in gRPCTargets.cmake +file(READ ${CURRENT_PACKAGES_DIR}/lib/cmake/gRPC/gRPCTargets.cmake _contents) +set(pattern "get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)\n") +string(REPLACE "${pattern}${pattern}" "${pattern}" _contents "${_contents}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/grpc/gRPCTargets.cmake "${_contents}") + +# Update paths in gRPCTargets-release.cmake +file(READ ${CURRENT_PACKAGES_DIR}/lib/cmake/gRPC/gRPCTargets-release.cmake _contents) +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 +file(READ ${CURRENT_PACKAGES_DIR}/debug/lib/cmake/gRPC/gRPCTargets-debug.cmake _contents) +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}") file(INSTALL ${CURRENT_BUILDTREES_DIR}/src/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/grpc RENAME copyright) file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools) file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Release/grpc_cpp_plugin.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools) +# Install tools and plugins +file( + INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Release/ + DESTINATION ${CURRENT_PACKAGES_DIR}/tools + FILES_MATCHING PATTERN "*.exe" +) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) |
