diff options
| author | tarcila <tarcila@users.noreply.github.com> | 2019-06-25 02:21:30 -0400 |
|---|---|---|
| committer | Phil Christensen <philc@microsoft.com> | 2019-06-24 23:21:30 -0700 |
| commit | 54b3be6b60466370d37edbe64fb6c6ede8487f04 (patch) | |
| tree | a6b420c4790b39c139806e538b17acb2ba260b8e /scripts | |
| parent | ecc4b1631f7e3252a8b84ab7564c83ecda8a6763 (diff) | |
| download | vcpkg-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.
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 14 |
1 files changed, 11 insertions, 3 deletions
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}") |
