mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-05 10:09:08 +08:00
[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.
This commit is contained in:
parent
ecc4b1631f
commit
54b3be6b60
@ -63,7 +63,7 @@ vcpkg_configure_cmake(
|
|||||||
-DgRPC_GFLAGS_PROVIDER=none
|
-DgRPC_GFLAGS_PROVIDER=none
|
||||||
-DgRPC_BENCHMARK_PROVIDER=none
|
-DgRPC_BENCHMARK_PROVIDER=none
|
||||||
-DgRPC_INSTALL_CSHARP_EXT=OFF
|
-DgRPC_INSTALL_CSHARP_EXT=OFF
|
||||||
-DgRPC_INSTALL_BINDIR:STRING=bin
|
-DgRPC_INSTALL_BINDIR:STRING=tools/grpc
|
||||||
-DgRPC_INSTALL_LIBDIR:STRING=lib
|
-DgRPC_INSTALL_LIBDIR:STRING=lib
|
||||||
-DgRPC_INSTALL_INCLUDEDIR:STRING=include
|
-DgRPC_INSTALL_INCLUDEDIR:STRING=include
|
||||||
-DgRPC_INSTALL_CMAKEDIR:STRING=share/grpc
|
-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)
|
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/grpc RENAME copyright)
|
||||||
|
|
||||||
# Install tools
|
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/grpc)
|
||||||
file(GLOB TOOLS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.exe")
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/tools")
|
||||||
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()
|
|
||||||
|
|
||||||
# Ignore the C# extension DLL in bin/
|
# Ignore the C# extension DLL in bin/
|
||||||
SET(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
SET(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
||||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||||
|
|
||||||
vcpkg_copy_pdbs()
|
vcpkg_copy_pdbs()
|
||||||
##
|
|
||||||
|
@ -4,7 +4,8 @@
|
|||||||
# Transform all /debug/share/<port>/*targets-debug.cmake files and move them to /share/<port>.
|
# 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
|
# 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.
|
# Fix ${_IMPORT_PREFIX} in auto generated targets to be one folder deeper.
|
||||||
# Replace ${CURRENT_INSTALLED_DIR} with ${_IMPORT_PREFIX} in configs/targets.
|
# 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})
|
set(_vfct_TARGET_PATH share/${PORT})
|
||||||
endif()
|
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(DEBUG_SHARE ${CURRENT_PACKAGES_DIR}/debug/${_vfct_TARGET_PATH})
|
||||||
set(RELEASE_SHARE ${CURRENT_PACKAGES_DIR}/${_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)
|
foreach(RELEASE_TARGET IN LISTS RELEASE_TARGETS)
|
||||||
file(READ ${RELEASE_TARGET} _contents)
|
file(READ ${RELEASE_TARGET} _contents)
|
||||||
string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" _contents "${_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}")
|
file(WRITE ${RELEASE_TARGET} "${_contents}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
@ -120,7 +128,7 @@ function(vcpkg_fixup_cmake_targets)
|
|||||||
|
|
||||||
file(READ ${DEBUG_TARGET} _contents)
|
file(READ ${DEBUG_TARGET} _contents)
|
||||||
string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" _contents "${_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}/lib" "\${_IMPORT_PREFIX}/debug/lib" _contents "${_contents}")
|
||||||
string(REPLACE "\${_IMPORT_PREFIX}/bin" "\${_IMPORT_PREFIX}/debug/bin" _contents "${_contents}")
|
string(REPLACE "\${_IMPORT_PREFIX}/bin" "\${_IMPORT_PREFIX}/debug/bin" _contents "${_contents}")
|
||||||
file(WRITE ${RELEASE_SHARE}/${DEBUG_TARGET_REL} "${_contents}")
|
file(WRITE ${RELEASE_SHARE}/${DEBUG_TARGET_REL} "${_contents}")
|
||||||
|
Loading…
Reference in New Issue
Block a user