Added parameter to vcpkg_copy_pdbs.cmake (#3688)

* - Added paths argument to locate pdbs.

* n/a

* - fixed line endings.

* [vcpkg-copy-pdbs] Tweak argument to replace patterns instead of adding patterns. Add slightly more detailed documentation.
This commit is contained in:
martin-s 2018-06-16 16:42:25 +00:00 committed by Robert Schumacher
parent 3726ce9557
commit c2b9c33adf
2 changed files with 24 additions and 3 deletions

View File

@ -4,12 +4,18 @@ Automatically locate pdbs in the build tree and copy them adjacent to all DLLs.
## Usage ## Usage
```cmake ```cmake
vcpkg_copy_pdbs() vcpkg_copy_pdbs([BUILD_PATHS <${CURRENT_PACKAGES_DIR}/bin/*.dll> ...])
``` ```
## Notes ## Notes
This command should always be called by portfiles after they have finished rearranging the binary output. This command should always be called by portfiles after they have finished rearranging the binary output.
## Parameters
### BUILD_PATHS
Path patterns passed to `file(GLOB_RECURSE)` for locating dlls.
Defaults to `${CURRENT_PACKAGES_DIR}/bin/*.dll` and `${CURRENT_PACKAGES_DIR}/debug/bin/*.dll`.
## Examples ## Examples
* [zlib](https://github.com/Microsoft/vcpkg/blob/master/ports/zlib/portfile.cmake) * [zlib](https://github.com/Microsoft/vcpkg/blob/master/ports/zlib/portfile.cmake)

View File

@ -4,17 +4,32 @@
## ##
## ## Usage ## ## Usage
## ```cmake ## ```cmake
## vcpkg_copy_pdbs() ## vcpkg_copy_pdbs([BUILD_PATHS <${CURRENT_PACKAGES_DIR}/bin/*.dll> ...])
## ``` ## ```
## ##
## ## Notes ## ## Notes
## This command should always be called by portfiles after they have finished rearranging the binary output. ## This command should always be called by portfiles after they have finished rearranging the binary output.
## ##
## ## Parameters
## ### BUILD_PATHS
## Path patterns passed to `file(GLOB_RECURSE)` for locating dlls.
##
## Defaults to `${CURRENT_PACKAGES_DIR}/bin/*.dll` and `${CURRENT_PACKAGES_DIR}/debug/bin/*.dll`.
##
## ## Examples ## ## Examples
## ##
## * [zlib](https://github.com/Microsoft/vcpkg/blob/master/ports/zlib/portfile.cmake) ## * [zlib](https://github.com/Microsoft/vcpkg/blob/master/ports/zlib/portfile.cmake)
## * [cpprestsdk](https://github.com/Microsoft/vcpkg/blob/master/ports/cpprestsdk/portfile.cmake) ## * [cpprestsdk](https://github.com/Microsoft/vcpkg/blob/master/ports/cpprestsdk/portfile.cmake)
function(vcpkg_copy_pdbs) function(vcpkg_copy_pdbs)
cmake_parse_arguments(_vcp "" "" "BUILD_PATHS" ${ARGN})
if(NOT _vcp_BUILD_PATHS)
set(
_vcp_BUILD_PATHS
${CURRENT_PACKAGES_DIR}/bin/*.dll
${CURRENT_PACKAGES_DIR}/debug/bin/*.dll
)
endif()
function(merge_filelist OUTVAR INVAR) function(merge_filelist OUTVAR INVAR)
set(MSG "") set(MSG "")
@ -25,7 +40,7 @@ function(vcpkg_copy_pdbs)
endfunction() endfunction()
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
file(GLOB_RECURSE DLLS ${CURRENT_PACKAGES_DIR}/bin/*.dll ${CURRENT_PACKAGES_DIR}/debug/bin/*.dll) file(GLOB_RECURSE DLLS ${_vcp_BUILD_PATHS})
set(DLLS_WITHOUT_MATCHING_PDBS) set(DLLS_WITHOUT_MATCHING_PDBS)