2020-12-02 05:37:26 +08:00
#[===[.md:
# vcpkg_copy_tool_dependencies
C o p y a l l D L L d e p e n d e n c i e s o f b u i l t t o o l s i n t o t h e t o o l f o l d e r .
## Usage
` ` ` c m a k e
vcpkg_copy_tool_dependencies ( < ${ CURRENT_PACKAGES_DIR } /tools/ ${ PORT } > )
` ` `
## Parameters
T h e p a t h t o t h e d i r e c t o r y c o n t a i n i n g t h e t o o l s .
## Notes
T h i s c o m m a n d s h o u l d a l w a y s b e c a l l e d b y p o r t f i l e s a f t e r t h e y h a v e f i n i s h e d r e a r r a n g i n g t h e b i n a r y o u t p u t , i f t h e y h a v e a n y t o o l s .
## Examples
* [ g l i b ] ( h t t p s : / / g i t h u b . c o m / M i c r o s o f t / v c p k g / b l o b / m a s t e r / p o r t s / g l i b / p o r t f i l e . c m a k e )
* [ f l t k ] ( h t t p s : / / g i t h u b . c o m / M i c r o s o f t / v c p k g / b l o b / m a s t e r / p o r t s / f l t k / p o r t f i l e . c m a k e )
#]===]
2017-01-14 09:59:41 +08:00
function ( vcpkg_copy_tool_dependencies TOOL_DIR )
2020-11-04 04:04:27 +08:00
if ( VCPKG_TARGET_IS_WINDOWS )
find_program ( PWSH_EXE pwsh )
if ( NOT PWSH_EXE )
2021-04-02 01:39:35 +08:00
if ( UNIX AND NOT CYGWIN )
message ( FATAL_ERROR "Could not find PowerShell Core; install PowerShell Core as described here: https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux" )
endif ( )
2020-11-04 04:04:27 +08:00
message ( FATAL_ERROR "Could not find PowerShell Core; please open an issue to report this." )
endif ( )
macro ( search_for_dependencies PATH_TO_SEARCH )
2020-12-19 04:00:45 +08:00
file ( GLOB TOOLS "${TOOL_DIR}/*.exe" "${TOOL_DIR}/*.dll" "${TOOL_DIR}/*.pyd" )
2020-11-04 04:04:27 +08:00
foreach ( TOOL IN LISTS TOOLS )
vcpkg_execute_required_process (
C O M M A N D " $ { P W S H _ E X E } " - n o p r o f i l e - e x e c u t i o n p o l i c y B y p a s s - n o l o g o
- f i l e " $ { S C R I P T S } / b u i l d s y s t e m s / m s b u i l d / a p p l o c a l . p s 1 "
- t a r g e t B i n a r y " $ { T O O L } "
- i n s t a l l e d D i r " $ { P A T H _ T O _ S E A R C H } "
W O R K I N G _ D I R E C T O R Y " $ { V C P K G _ R O O T _ D I R } "
L O G N A M E c o p y - t o o l - d e p e n d e n c i e s
)
endforeach ( )
endmacro ( )
search_for_dependencies ( "${CURRENT_PACKAGES_DIR}/bin" )
search_for_dependencies ( "${CURRENT_INSTALLED_DIR}/bin" )
2020-08-11 06:40:21 +08:00
endif ( )
2017-01-12 04:20:53 +08:00
endfunction ( )