diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-05-06 23:02:25 -0700 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2017-05-06 23:02:25 -0700 |
| commit | 8df90aaa603064a87eca870a21a3933a316f7441 (patch) | |
| tree | 4283a7f0e302c332a92ece80c1c450c3d8e8ca87 /scripts | |
| parent | 68159355be589c14f464d57429a705567457c917 (diff) | |
| download | vcpkg-8df90aaa603064a87eca870a21a3933a316f7441.tar.gz vcpkg-8df90aaa603064a87eca870a21a3933a316f7441.zip | |
[grpc] Use vcpkg_fixup_cmake_targets() and improve file layout.
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index c2829be7e..f753f6396 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -4,6 +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 +# # :: # vcpkg_fixup_cmake_targets() # @@ -15,19 +17,29 @@ function(vcpkg_fixup_cmake_targets) set(RELEASE_SHARE ${CURRENT_PACKAGES_DIR}/share/${PORT}) if(NOT EXISTS ${DEBUG_SHARE}) - message(FATAL_ERROR "'${DEBUG_SHARE}' does not exist") + message(FATAL_ERROR "'${DEBUG_SHARE}' does not exist.") endif() - file(GLOB UNUSED_FILES "${DEBUG_SHARE}/*[Tt]argets.cmake" "${DEBUG_SHARE}/*[Cc]onfig.cmake") + file(GLOB UNUSED_FILES "${DEBUG_SHARE}/*[Tt]argets.cmake" "${DEBUG_SHARE}/*[Cc]onfig.cmake" "${DEBUG_SHARE}/*[Cc]onfigVersion.cmake") file(REMOVE ${UNUSED_FILES}) - file(GLOB DEBUG_TARGETS "${DEBUG_SHARE}/*[Tt]argets-debug.cmake") + file(GLOB RELEASE_TARGETS "${RELEASE_SHARE}/*[Tt]argets-release.cmake") + foreach(RELEASE_TARGET ${RELEASE_TARGETS}) + get_filename_component(RELEASE_TARGET_NAME ${RELEASE_TARGET} NAME) + file(READ ${RELEASE_TARGET} _contents) + string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \"]+\\.exe)" "\${_IMPORT_PREFIX}/tools/${PORT}/\\1" _contents "${_contents}") + file(WRITE ${RELEASE_TARGET} "${_contents}") + endforeach() + + file(GLOB DEBUG_TARGETS "${DEBUG_SHARE}/*[Tt]argets-debug.cmake") foreach(DEBUG_TARGET ${DEBUG_TARGETS}) get_filename_component(DEBUG_TARGET_NAME ${DEBUG_TARGET} NAME) file(READ ${DEBUG_TARGET} _contents) - string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" _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}") file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/${DEBUG_TARGET_NAME} "${_contents}") file(REMOVE ${DEBUG_TARGET}) |
