From 0ab1a9e1c64a3968631b59647e771beda7d1f256 Mon Sep 17 00:00:00 2001 From: myd7349 Date: Sat, 2 May 2020 06:28:55 +0800 Subject: [vcpkg] Add new function vcpkg_copy_tools (#8749) * [vcpkg] Add new function vcpkg_copy_tools * [cpuinfo][czmq][nanomsg][uriparser] Use vcpkg_copy_tools * [czmq] Clean even tools are not copied [libsvm][zyre] Use vcpkg_copy_tools * [vcpkg-copy-tools] Clean debug/bin This should fix czmq build error * [czmq] czmq does not have BUILD_TOOLS option * [vcpkg] Split clean logic into another function * [cpuinfo][czmq][nanomsg][uriparser] Fix calling of vcpkg_copy_tools * [zyre] Fix regression error * [vcpkg] Update try_remove_empty_directory * [libsvm] Fix vcpkg_copy_tools call --- docs/maintainers/maintainer-guide.md | 1 + docs/maintainers/portfile-functions.md | 2 ++ docs/maintainers/vcpkg_clean_executables_in_bin.md | 23 +++++++++++++++++ docs/maintainers/vcpkg_copy_tools.md | 30 ++++++++++++++++++++++ 4 files changed, 56 insertions(+) create mode 100644 docs/maintainers/vcpkg_clean_executables_in_bin.md create mode 100644 docs/maintainers/vcpkg_copy_tools.md (limited to 'docs') diff --git a/docs/maintainers/maintainer-guide.md b/docs/maintainers/maintainer-guide.md index 624aa46d3..0b6532258 100644 --- a/docs/maintainers/maintainer-guide.md +++ b/docs/maintainers/maintainer-guide.md @@ -42,6 +42,7 @@ At this time, the following helpers are deprecated: 1. `vcpkg_extract_source_archive()` should be replaced by [`vcpkg_extract_source_archive_ex()`](vcpkg_extract_source_archive_ex.md) 2. `vcpkg_apply_patches()` should be replaced by the `PATCHES` arguments to the "extract" helpers (e.g. [`vcpkg_from_github()`](vcpkg_from_github.md)) 3. `vcpkg_build_msbuild()` should be replaced by [`vcpkg_install_msbuild()`](vcpkg_install_msbuild.md) +4. `vcpkg_copy_tool_dependencies()` should be replaced by [`vcpkg_copy_tools()`](vcpkg_copy_tools.md) ### Avoid excessive comments in portfiles diff --git a/docs/maintainers/portfile-functions.md b/docs/maintainers/portfile-functions.md index 776ffdefc..4cd42a685 100644 --- a/docs/maintainers/portfile-functions.md +++ b/docs/maintainers/portfile-functions.md @@ -11,12 +11,14 @@ - [vcpkg\_build\_nmake](vcpkg_build_nmake.md) - [vcpkg\_check\_features](vcpkg_check_features.md) - [vcpkg\_check\_linkage](vcpkg_check_linkage.md) +- [vcpkg\_clean\_executables\_in\_bin](vcpkg_clean_executables_in_bin.md) - [vcpkg\_clean\_msbuild](vcpkg_clean_msbuild.md) - [vcpkg\_common\_definitions](vcpkg_common_definitions.md) - [vcpkg\_configure\_cmake](vcpkg_configure_cmake.md) - [vcpkg\_configure\_make](vcpkg_configure_make.md) - [vcpkg\_configure\_meson](vcpkg_configure_meson.md) - [vcpkg\_copy\_pdbs](vcpkg_copy_pdbs.md) +- [vcpkg\_copy\_tools](vcpkg_copy_tools.md) - [vcpkg\_copy\_tool\_dependencies](vcpkg_copy_tool_dependencies.md) - [vcpkg\_download\_distfile](vcpkg_download_distfile.md) - [vcpkg\_execute\_build\_process](vcpkg_execute_build_process.md) diff --git a/docs/maintainers/vcpkg_clean_executables_in_bin.md b/docs/maintainers/vcpkg_clean_executables_in_bin.md new file mode 100644 index 000000000..36342790b --- /dev/null +++ b/docs/maintainers/vcpkg_clean_executables_in_bin.md @@ -0,0 +1,23 @@ +# vcpkg_clean_executables_in_bin + +Remove specified executables found in `${CURRENT_PACKAGES_DIR}/bin` and `${CURRENT_PACKAGES_DIR}/debug/bin`. If, after all specified executables have been removed, and the `bin` and `debug/bin` directories are empty, then also delete `bin` and `debug/bin` directories. + +## Usage +```cmake +vcpkg_clean_executables_in_bin( + FILE_NAMES ... +) +``` + +## Parameters +### FILE_NAMES +A list of executable filenames without extension. + +## Notes +Generally, there is no need to call this function manually. Instead, pass an extra `AUTO_CLEAN` argument when calling `vcpkg_copy_tools`. + +## Examples +* [czmq](https://github.com/microsoft/vcpkg/blob/master/ports/czmq/portfile.cmake) + +## Source +[scripts/cmake/vcpkg_clean_executables_in_bin.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_clean_executables_in_bin.cmake) diff --git a/docs/maintainers/vcpkg_copy_tools.md b/docs/maintainers/vcpkg_copy_tools.md new file mode 100644 index 000000000..1a553eb40 --- /dev/null +++ b/docs/maintainers/vcpkg_copy_tools.md @@ -0,0 +1,30 @@ +# vcpkg_copy_tools + +Copy tools and all their DLL dependencies into the `tools` folder. + +## Usage +```cmake +vcpkg_copy_tools( + TOOL_NAMES ... + [SEARCH_DIR <${CURRENT_PACKAGES_DIR}/bin>] + [AUTO_CLEAN] +) +``` +## Parameters +### TOOL_NAMES +A list of tool filenames without extension. + +### SEARCH_DIR +The path to the directory containing the tools. This will be set to `${CURRENT_PACKAGES_DIR}/bin` if ommited. + +### AUTO_CLEAN +Auto clean executables in `${CURRENT_PACKAGES_DIR}/bin` and `${CURRENT_PACKAGES_DIR}/debug/bin`. + +## Examples + +* [cpuinfo](https://github.com/microsoft/vcpkg/blob/master/ports/cpuinfo/portfile.cmake) +* [nanomsg](https://github.com/microsoft/vcpkg/blob/master/ports/nanomsg/portfile.cmake) +* [uriparser](https://github.com/microsoft/vcpkg/blob/master/ports/uriparser/portfile.cmake) + +## Source +[scripts/cmake/vcpkg_copy_tools.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_copy_tools.cmake) -- cgit v1.2.3