mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 19:25:27 +08:00
191c864927
* - Added scripts variable to ports file. - Added check if triplet file is not available (NPE). * - Fixed line endings. * Provide location of .vcpkg-root to ports.cmake * vcpkg sets VCPKG_ROOT_PATH in ports.cmake * [vcpkg] Fail if VCPKG_ROOT_PATH is not passed from vcpkg.exe * [vcpkg] Fix vcpkg rooth path * [vcpkg] Make --x-scripts-root an experimental command
33 lines
1.2 KiB
CMake
33 lines
1.2 KiB
CMake
## # vcpkg_copy_tool_dependencies
|
|
##
|
|
## Copy all DLL dependencies of built tools into the tool folder.
|
|
##
|
|
## ## Usage
|
|
## ```cmake
|
|
## vcpkg_copy_tool_dependencies(<${CURRENT_PACKAGES_DIR}/tools/${PORT}>)
|
|
## ```
|
|
## ## Parameters
|
|
## The path to the directory containing the tools.
|
|
##
|
|
## ## Notes
|
|
## This command should always be called by portfiles after they have finished rearranging the binary output, if they have any tools.
|
|
##
|
|
## ## Examples
|
|
##
|
|
## * [glib](https://github.com/Microsoft/vcpkg/blob/master/ports/glib/portfile.cmake)
|
|
## * [fltk](https://github.com/Microsoft/vcpkg/blob/master/ports/fltk/portfile.cmake)
|
|
function(vcpkg_copy_tool_dependencies TOOL_DIR)
|
|
macro(search_for_dependencies PATH_TO_SEARCH)
|
|
file(GLOB TOOLS ${TOOL_DIR}/*.exe ${TOOL_DIR}/*.dll)
|
|
foreach(TOOL ${TOOLS})
|
|
execute_process(COMMAND powershell -noprofile -executionpolicy Bypass -nologo
|
|
-file ${SCRIPTS}/buildsystems/msbuild/applocal.ps1
|
|
-targetBinary ${TOOL}
|
|
-installedDir ${PATH_TO_SEARCH}
|
|
OUTPUT_VARIABLE OUT)
|
|
endforeach()
|
|
endmacro()
|
|
search_for_dependencies(${CURRENT_PACKAGES_DIR}/bin)
|
|
search_for_dependencies(${CURRENT_INSTALLED_DIR}/bin)
|
|
endfunction()
|