aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortarcila <tarcila@users.noreply.github.com>2019-06-25 02:21:30 -0400
committerPhil Christensen <philc@microsoft.com>2019-06-24 23:21:30 -0700
commit54b3be6b60466370d37edbe64fb6c6ede8487f04 (patch)
treea6b420c4790b39c139806e538b17acb2ba260b8e
parentecc4b1631f7e3252a8b84ab7564c83ecda8a6763 (diff)
downloadvcpkg-54b3be6b60466370d37edbe64fb6c6ede8487f04.tar.gz
vcpkg-54b3be6b60466370d37edbe64fb6c6ede8487f04.zip
[scripts] Fix vcpkg_fixup_cmake on non Windows platforms (#5630)
* [scripts] Fix vcpkg_fixup_cmake on non Windows platforms Script was only handling tools executables ending with .exe. Changed it so anything under /bin/ in transformed. This fixes for instance FlatcTargets-release.cmake from flatbuffers port on osx.
-rw-r--r--ports/grpc/portfile.cmake17
-rw-r--r--scripts/cmake/vcpkg_fixup_cmake_targets.cmake14
2 files changed, 14 insertions, 17 deletions
diff --git a/ports/grpc/portfile.cmake b/ports/grpc/portfile.cmake
index b71a55420..2dca1c34c 100644
--- a/ports/grpc/portfile.cmake
+++ b/ports/grpc/portfile.cmake
@@ -63,7 +63,7 @@ vcpkg_configure_cmake(
-DgRPC_GFLAGS_PROVIDER=none
-DgRPC_BENCHMARK_PROVIDER=none
-DgRPC_INSTALL_CSHARP_EXT=OFF
- -DgRPC_INSTALL_BINDIR:STRING=bin
+ -DgRPC_INSTALL_BINDIR:STRING=tools/grpc
-DgRPC_INSTALL_LIBDIR:STRING=lib
-DgRPC_INSTALL_INCLUDEDIR:STRING=include
-DgRPC_INSTALL_CMAKEDIR:STRING=share/grpc
@@ -76,22 +76,11 @@ vcpkg_fixup_cmake_targets()
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/grpc RENAME copyright)
-# Install tools
-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)
- vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/grpc)
-endif()
-
-file(GLOB EXES "${CURRENT_PACKAGES_DIR}/bin/*.exe" "${CURRENT_PACKAGES_DIR}/debug/bin/*.exe")
-if(EXES)
- file(REMOVE ${EXES})
-endif()
+vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/grpc)
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/tools")
# Ignore the C# extension DLL in bin/
SET(VCPKG_POLICY_EMPTY_PACKAGE enabled)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
vcpkg_copy_pdbs()
-##
diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake
index 982f414b6..1e0f2493d 100644
--- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake
+++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake
@@ -4,7 +4,8 @@
# Transform all /debug/share/<port>/*targets-debug.cmake files and move them to /share/<port>.
# Removes all /debug/share/<port>/*targets.cmake and /debug/share/<port>/*config.cmake
#
-# Transform all references matching /bin/*.exe to /tools/<port>/*.exe
+# Transform all references matching /bin/*.exe to /tools/<port>/*.exe on Windows
+# Transform all references matching /bin/* to /tools/<port>/* on other platforms
#
# Fix ${_IMPORT_PREFIX} in auto generated targets to be one folder deeper.
# Replace ${CURRENT_INSTALLED_DIR} with ${_IMPORT_PREFIX} in configs/targets.
@@ -27,6 +28,13 @@ function(vcpkg_fixup_cmake_targets)
set(_vfct_TARGET_PATH share/${PORT})
endif()
+
+ if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+ set(EXECUTABLE_SUFFIX "\\.exe")
+ else()
+ set(EXECUTABLE_SUFFIX)
+ endif()
+
set(DEBUG_SHARE ${CURRENT_PACKAGES_DIR}/debug/${_vfct_TARGET_PATH})
set(RELEASE_SHARE ${CURRENT_PACKAGES_DIR}/${_vfct_TARGET_PATH})
@@ -107,7 +115,7 @@ function(vcpkg_fixup_cmake_targets)
foreach(RELEASE_TARGET IN LISTS 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}")
+ string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \"]+${EXECUTABLE_SUFFIX})" "\${_IMPORT_PREFIX}/tools/${PORT}/\\1" _contents "${_contents}")
file(WRITE ${RELEASE_TARGET} "${_contents}")
endforeach()
@@ -120,7 +128,7 @@ function(vcpkg_fixup_cmake_targets)
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(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \";]+${EXECUTABLE_SUFFIX})" "\${_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}")
file(WRITE ${RELEASE_SHARE}/${DEBUG_TARGET_REL} "${_contents}")