|
17 | 17 | ## * [glib](https://github.com/Microsoft/vcpkg/blob/master/ports/glib/portfile.cmake)
|
18 | 18 | ## * [fltk](https://github.com/Microsoft/vcpkg/blob/master/ports/fltk/portfile.cmake)
|
19 | 19 | function(vcpkg_copy_tool_dependencies TOOL_DIR)
|
20 |
| - find_program(PWSH_EXE pwsh) |
21 |
| - if (NOT PWSH_EXE) |
22 |
| - message(FATAL_ERROR "Could not find PowerShell Core; please open an issue to report this.") |
| 20 | + if (VCPKG_TARGET_IS_WINDOWS) |
| 21 | + find_program(PWSH_EXE pwsh) |
| 22 | + if (NOT PWSH_EXE) |
| 23 | + message(FATAL_ERROR "Could not find PowerShell Core; please open an issue to report this.") |
| 24 | + endif() |
| 25 | + macro(search_for_dependencies PATH_TO_SEARCH) |
| 26 | + file(GLOB TOOLS "${TOOL_DIR}/*.exe" "${TOOL_DIR}/*.dll") |
| 27 | + foreach(TOOL IN LISTS TOOLS) |
| 28 | + vcpkg_execute_required_process( |
| 29 | + COMMAND "${PWSH_EXE}" -noprofile -executionpolicy Bypass -nologo |
| 30 | + -file "${SCRIPTS}/buildsystems/msbuild/applocal.ps1" |
| 31 | + -targetBinary "${TOOL}" |
| 32 | + -installedDir "${PATH_TO_SEARCH}" |
| 33 | + WORKING_DIRECTORY "${VCPKG_ROOT_DIR}" |
| 34 | + LOGNAME copy-tool-dependencies |
| 35 | + ) |
| 36 | + endforeach() |
| 37 | + endmacro() |
| 38 | + search_for_dependencies("${CURRENT_PACKAGES_DIR}/bin") |
| 39 | + search_for_dependencies("${CURRENT_INSTALLED_DIR}/bin") |
23 | 40 | endif()
|
24 |
| - macro(search_for_dependencies PATH_TO_SEARCH) |
25 |
| - file(GLOB TOOLS "${TOOL_DIR}/*.exe" "${TOOL_DIR}/*.dll") |
26 |
| - foreach(TOOL IN LISTS TOOLS) |
27 |
| - vcpkg_execute_required_process( |
28 |
| - COMMAND "${PWSH_EXE}" -noprofile -executionpolicy Bypass -nologo |
29 |
| - -file "${SCRIPTS}/buildsystems/msbuild/applocal.ps1" |
30 |
| - -targetBinary "${TOOL}" |
31 |
| - -installedDir "${PATH_TO_SEARCH}" |
32 |
| - WORKING_DIRECTORY "${VCPKG_ROOT_DIR}" |
33 |
| - LOGNAME copy-tool-dependencies |
34 |
| - ) |
35 |
| - endforeach() |
36 |
| - endmacro() |
37 |
| - search_for_dependencies("${CURRENT_PACKAGES_DIR}/bin") |
38 |
| - search_for_dependencies("${CURRENT_INSTALLED_DIR}/bin") |
39 | 41 | endfunction()
|
0 commit comments