diff --git a/docs/maintainers/execute_process.md b/docs/maintainers/execute_process.md index 21bca7f3ae24e6..f8b866ae17385f 100644 --- a/docs/maintainers/execute_process.md +++ b/docs/maintainers/execute_process.md @@ -1,9 +1,11 @@ # execute_process +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/execute_process.md). + Intercepts all calls to execute_process() inside portfiles and fails when Download Mode is enabled. In order to execute a process in Download Mode call `vcpkg_execute_in_download_mode()` instead. ## Source -[scripts/cmake/execute_process.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/execute_process.cmake) +[scripts/cmake/execute\_process.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/execute_process.cmake) diff --git a/docs/maintainers/internal/vcpkg_internal_get_cmake_vars.md b/docs/maintainers/internal/vcpkg_internal_get_cmake_vars.md index dbac8458757e3d..62ac8080c0316e 100644 --- a/docs/maintainers/internal/vcpkg_internal_get_cmake_vars.md +++ b/docs/maintainers/internal/vcpkg_internal_get_cmake_vars.md @@ -1,5 +1,7 @@ # vcpkg_internal_get_cmake_vars +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/). + **Only for internal use in vcpkg helpers. Behavior and arguments will change without notice.** Runs a cmake configure with a dummy project to extract certain cmake variables @@ -26,4 +28,4 @@ If possible avoid usage in portfiles. * [vcpkg_configure_make](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_configure_make.cmake) ## Source -[scripts/cmake/vcpkg_internal_get_cmake_vars.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_internal_get_cmake_vars.cmake) +[scripts/cmake/vcpkg\_internal\_get\_cmake\_vars.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_internal_get_cmake_vars.cmake) diff --git a/docs/maintainers/internal/z_vcpkg_apply_patches.md b/docs/maintainers/internal/z_vcpkg_apply_patches.md new file mode 100644 index 00000000000000..e4d54caf420561 --- /dev/null +++ b/docs/maintainers/internal/z_vcpkg_apply_patches.md @@ -0,0 +1,32 @@ +# z_vcpkg_apply_patches + +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/). + +**Only for internal use in vcpkg helpers. Behavior and arguments will change without notice.** + +Apply a set of patches to a source tree. + +```cmake +z_vcpkg_apply_patches( + SOURCE_PATH + [QUIET] + PATCHES ... +) +``` + +The `` should be set to `${SOURCE_PATH}` by convention, +and is the path to apply the patches in. + +`z_vcpkg_apply_patches` will take the list of ``es, +which are by default relative to the port directory, +and apply them in order using `git apply`. +Generally, these ``es take the form of `some.patch` +to select patches in the port directory. +One may also download patches and use `${VCPKG_DOWNLOADS}/path/to/some.patch`. + +If `QUIET` is not passed, it is a fatal error for a patch to fail to apply; +otherwise, if `QUIET` is passed, no message is printed. +This should only be used for edge cases, such as patches that are known to fail even on a clean source tree. + +## Source +[scripts/cmake/z\_vcpkg\_apply\_patches.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/z_vcpkg_apply_patches.cmake) diff --git a/docs/maintainers/internal/z_vcpkg_function_arguments.md b/docs/maintainers/internal/z_vcpkg_function_arguments.md index e60407f205b435..a31d8b33c0a092 100644 --- a/docs/maintainers/internal/z_vcpkg_function_arguments.md +++ b/docs/maintainers/internal/z_vcpkg_function_arguments.md @@ -1,5 +1,7 @@ # z_vcpkg_function_arguments +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/). + **Only for internal use in vcpkg helpers. Behavior and arguments will change without notice.** Get a list of the arguments which were passed in. Unlike `ARGV`, which is simply the arguments joined with `;`, @@ -24,4 +26,4 @@ endfunction() ``` ## Source -[scripts/cmake/z_vcpkg_function_arguments.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/z_vcpkg_function_arguments.cmake) +[scripts/cmake/z\_vcpkg\_function\_arguments.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/z_vcpkg_function_arguments.cmake) diff --git a/docs/maintainers/internal/z_vcpkg_prettify_command_line.md b/docs/maintainers/internal/z_vcpkg_prettify_command_line.md index 1b763663030d3f..9bbb1c457d3482 100644 --- a/docs/maintainers/internal/z_vcpkg_prettify_command_line.md +++ b/docs/maintainers/internal/z_vcpkg_prettify_command_line.md @@ -1,5 +1,7 @@ # z_vcpkg_prettify_command_line +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/). + **Only for internal use in vcpkg helpers. Behavior and arguments will change without notice.** Turn a command line into a formatted string. @@ -16,4 +18,4 @@ This command is for internal use, when printing out to a message. * `scripts/cmake/vcpkg_execute_required_process_repeat.cmake` ## Source -[scripts/cmake/z_vcpkg_prettify_command_line.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/z_vcpkg_prettify_command_line.cmake) +[scripts/cmake/z\_vcpkg\_prettify\_command\_line.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/z_vcpkg_prettify_command_line.cmake) diff --git a/docs/maintainers/portfile-functions.md b/docs/maintainers/portfile-functions.md index c92abc2c67895e..e5f8e6e92d367a 100644 --- a/docs/maintainers/portfile-functions.md +++ b/docs/maintainers/portfile-functions.md @@ -1,10 +1,10 @@ - + # Portfile helper functions - [execute\_process](execute_process.md) - [vcpkg\_acquire\_msys](vcpkg_acquire_msys.md) - [vcpkg\_add\_to\_path](vcpkg_add_to_path.md) -- [vcpkg\_apply\_patches](vcpkg_apply_patches.md) +- [vcpkg\_apply\_patches](vcpkg_apply_patches.md) (deprecated) - [vcpkg\_build\_cmake](vcpkg_build_cmake.md) - [vcpkg\_build\_gn](vcpkg_build_gn.md) - [vcpkg\_build\_make](vcpkg_build_make.md) @@ -58,5 +58,8 @@ ## Internal Functions - [vcpkg\_internal\_get\_cmake\_vars](internal/vcpkg_internal_get_cmake_vars.md) +- [z\_vcpkg\_apply\_patches](internal/z_vcpkg_apply_patches.md) - [z\_vcpkg\_function\_arguments](internal/z_vcpkg_function_arguments.md) - [z\_vcpkg\_prettify\_command\_line](internal/z_vcpkg_prettify_command_line.md) + +## Scripts from Ports diff --git a/docs/maintainers/vcpkg_acquire_msys.md b/docs/maintainers/vcpkg_acquire_msys.md index d4969323e52e23..6106a5adaf8be4 100644 --- a/docs/maintainers/vcpkg_acquire_msys.md +++ b/docs/maintainers/vcpkg_acquire_msys.md @@ -1,5 +1,7 @@ # vcpkg_acquire_msys +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_acquire_msys.md). + Download and prepare an MSYS2 instance. ## Usage @@ -55,4 +57,4 @@ vcpkg_execute_required_process( * [libvpx](https://github.com/Microsoft/vcpkg/blob/master/ports/libvpx/portfile.cmake) ## Source -[scripts/cmake/vcpkg_acquire_msys.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_acquire_msys.cmake) +[scripts/cmake/vcpkg\_acquire\_msys.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_acquire_msys.cmake) diff --git a/docs/maintainers/vcpkg_add_to_path.md b/docs/maintainers/vcpkg_add_to_path.md index 2437576387f550..9c982b41e415f3 100644 --- a/docs/maintainers/vcpkg_add_to_path.md +++ b/docs/maintainers/vcpkg_add_to_path.md @@ -1,5 +1,7 @@ # vcpkg_add_to_path +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_add_to_path.md). + Add a directory or directories to the PATH environment variable ```cmake @@ -22,4 +24,4 @@ If no paths are passed, then nothing will be done. * [z3](https://github.com/Microsoft/vcpkg/blob/master/ports/z3/portfile.cmake#L13) ## Source -[scripts/cmake/vcpkg_add_to_path.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_add_to_path.cmake) +[scripts/cmake/vcpkg\_add\_to\_path.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_add_to_path.cmake) diff --git a/docs/maintainers/vcpkg_apply_patches.md b/docs/maintainers/vcpkg_apply_patches.md index cfcf6ff15f6d34..460593b34c4c9b 100644 --- a/docs/maintainers/vcpkg_apply_patches.md +++ b/docs/maintainers/vcpkg_apply_patches.md @@ -1,8 +1,11 @@ # vcpkg_apply_patches -Apply a set of patches to a source tree. This function is deprecated in favor of the `PATCHES` argument to `vcpkg_from_github()` et al. +**This function has been deprecated in favor of the `PATCHES` argument to `vcpkg_from_github()` et al.** + +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_apply_patches.md). + +Apply a set of patches to a source tree. -## Usage ```cmake vcpkg_apply_patches( SOURCE_PATH <${SOURCE_PATH}> @@ -11,24 +14,5 @@ vcpkg_apply_patches( ) ``` -## Parameters -### SOURCE_PATH -The source path in which apply the patches. By convention, this is usually set in the portfile as the variable `SOURCE_PATH`. - -### PATCHES -A list of patches that are applied to the source tree. - -Generally, these take the form of `${CMAKE_CURRENT_LIST_DIR}/some.patch` to select patches in the `port\\` directory. - -### QUIET -Disables the warning message upon failure. - -This should only be used for edge cases, such as patches that are known to fail even on a clean source tree. - -## Examples - -* [libbson](https://github.com/Microsoft/vcpkg/blob/master/ports/libbson/portfile.cmake) -* [gdal](https://github.com/Microsoft/vcpkg/blob/master/ports/gdal/portfile.cmake) - ## Source -[scripts/cmake/vcpkg_apply_patches.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_apply_patches.cmake) +[scripts/cmake/vcpkg\_apply\_patches.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_apply_patches.cmake) diff --git a/docs/maintainers/vcpkg_build_cmake.md b/docs/maintainers/vcpkg_build_cmake.md index f75d050c32c823..2f71058861d06f 100644 --- a/docs/maintainers/vcpkg_build_cmake.md +++ b/docs/maintainers/vcpkg_build_cmake.md @@ -1,5 +1,7 @@ # vcpkg_build_cmake +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_build_cmake.md). + Build a cmake project. ## Usage: @@ -31,4 +33,4 @@ You can use the alias [`vcpkg_install_cmake()`](vcpkg_configure_cmake.md) functi * [opencv](https://github.com/Microsoft/vcpkg/blob/master/ports/opencv/portfile.cmake) ## Source -[scripts/cmake/vcpkg_build_cmake.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_build_cmake.cmake) +[scripts/cmake/vcpkg\_build\_cmake.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_build_cmake.cmake) diff --git a/docs/maintainers/vcpkg_build_gn.md b/docs/maintainers/vcpkg_build_gn.md index 0f5f2e8b06c487..20930b6836c0c5 100644 --- a/docs/maintainers/vcpkg_build_gn.md +++ b/docs/maintainers/vcpkg_build_gn.md @@ -1,5 +1,7 @@ # vcpkg_build_gn +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_build_gn.md). + Build a GN project ## Usage: @@ -14,4 +16,4 @@ vcpkg_build_gn( Only build the specified targets. ## Source -[scripts/cmake/vcpkg_build_gn.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_build_gn.cmake) +[scripts/cmake/vcpkg\_build\_gn.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_build_gn.cmake) diff --git a/docs/maintainers/vcpkg_build_make.md b/docs/maintainers/vcpkg_build_make.md index 6da602f3e72175..9f06d5cfce27c9 100644 --- a/docs/maintainers/vcpkg_build_make.md +++ b/docs/maintainers/vcpkg_build_make.md @@ -1,5 +1,7 @@ # vcpkg_build_make +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_build_make.md). + Build a linux makefile project. ## Usage: @@ -49,4 +51,4 @@ You can use the alias [`vcpkg_install_make()`](vcpkg_install_make.md) function i * [libosip2](https://github.com/Microsoft/vcpkg/blob/master/ports/libosip2/portfile.cmake) ## Source -[scripts/cmake/vcpkg_build_make.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_build_make.cmake) +[scripts/cmake/vcpkg\_build\_make.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_build_make.cmake) diff --git a/docs/maintainers/vcpkg_build_msbuild.md b/docs/maintainers/vcpkg_build_msbuild.md index e011bfbc8ec70e..3a77bed0dcdd04 100644 --- a/docs/maintainers/vcpkg_build_msbuild.md +++ b/docs/maintainers/vcpkg_build_msbuild.md @@ -1,5 +1,7 @@ # vcpkg_build_msbuild +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_build_msbuild.md). + Build a msbuild-based project. Deprecated in favor of `vcpkg_install_msbuild()`. ## Usage @@ -61,4 +63,4 @@ Additional options passed to msbuild for Debug builds. These are in addition to * [chakracore](https://github.com/Microsoft/vcpkg/blob/master/ports/chakracore/portfile.cmake) ## Source -[scripts/cmake/vcpkg_build_msbuild.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_build_msbuild.cmake) +[scripts/cmake/vcpkg\_build\_msbuild.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_build_msbuild.cmake) diff --git a/docs/maintainers/vcpkg_build_ninja.md b/docs/maintainers/vcpkg_build_ninja.md index 758249966d7607..a74de2c6cbd4e8 100644 --- a/docs/maintainers/vcpkg_build_ninja.md +++ b/docs/maintainers/vcpkg_build_ninja.md @@ -1,5 +1,7 @@ # vcpkg_build_ninja +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_build_ninja.md). + Build a ninja project ## Usage: @@ -14,4 +16,4 @@ vcpkg_build_ninja( Only build the specified targets. ## Source -[scripts/cmake/vcpkg_build_ninja.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_build_ninja.cmake) +[scripts/cmake/vcpkg\_build\_ninja.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_build_ninja.cmake) diff --git a/docs/maintainers/vcpkg_build_nmake.md b/docs/maintainers/vcpkg_build_nmake.md index 55257b50dd8c96..33160d429e9592 100644 --- a/docs/maintainers/vcpkg_build_nmake.md +++ b/docs/maintainers/vcpkg_build_nmake.md @@ -1,5 +1,7 @@ # vcpkg_build_nmake +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_build_nmake.md). + Build a msvc makefile project. ## Usage: @@ -73,4 +75,4 @@ You can use the alias [`vcpkg_install_nmake()`](vcpkg_install_nmake.md) function * [freexl](https://github.com/Microsoft/vcpkg/blob/master/ports/freexl/portfile.cmake) ## Source -[scripts/cmake/vcpkg_build_nmake.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_build_nmake.cmake) +[scripts/cmake/vcpkg\_build\_nmake.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_build_nmake.cmake) diff --git a/docs/maintainers/vcpkg_build_qmake.md b/docs/maintainers/vcpkg_build_qmake.md index c899155bdf8416..96d388f3a70478 100644 --- a/docs/maintainers/vcpkg_build_qmake.md +++ b/docs/maintainers/vcpkg_build_qmake.md @@ -1,5 +1,7 @@ # vcpkg_build_qmake +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_build_qmake.md). + Build a qmake-based project, previously configured using vcpkg_configure_qmake. ```cmake @@ -7,4 +9,4 @@ vcpkg_build_qmake() ``` ## Source -[scripts/cmake/vcpkg_build_qmake.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_build_qmake.cmake) +[scripts/cmake/vcpkg\_build\_qmake.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_build_qmake.cmake) diff --git a/docs/maintainers/vcpkg_buildpath_length_warning.md b/docs/maintainers/vcpkg_buildpath_length_warning.md index fdc7adedae2629..1b09fca5ed7548 100644 --- a/docs/maintainers/vcpkg_buildpath_length_warning.md +++ b/docs/maintainers/vcpkg_buildpath_length_warning.md @@ -1,5 +1,7 @@ # vcpkg_buildpath_length_warning +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_buildpath_length_warning.md). + Warns the user if their vcpkg installation path might be too long for the package they're installing. ```cmake @@ -11,4 +13,4 @@ path to `buildtrees` is bigger than `N`. Note that this is simply a warning, and isn't relied on for correctness. ## Source -[scripts/cmake/vcpkg_buildpath_length_warning.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_buildpath_length_warning.cmake) +[scripts/cmake/vcpkg\_buildpath\_length\_warning.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_buildpath_length_warning.cmake) diff --git a/docs/maintainers/vcpkg_check_features.md b/docs/maintainers/vcpkg_check_features.md index beb599664b1205..23144a6ef145e3 100644 --- a/docs/maintainers/vcpkg_check_features.md +++ b/docs/maintainers/vcpkg_check_features.md @@ -1,4 +1,6 @@ # vcpkg_check_features + +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_check_features.md). Check if one or more features are a part of a package installation. ## Usage @@ -144,4 +146,4 @@ vcpkg_configure_cmake( * [rocksdb](https://github.com/microsoft/vcpkg/blob/master/ports/rocksdb/portfile.cmake) ## Source -[scripts/cmake/vcpkg_check_features.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_check_features.cmake) +[scripts/cmake/vcpkg\_check\_features.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_check_features.cmake) diff --git a/docs/maintainers/vcpkg_check_linkage.md b/docs/maintainers/vcpkg_check_linkage.md index 9c0c823adb1a81..dbda0a33c6b1fc 100644 --- a/docs/maintainers/vcpkg_check_linkage.md +++ b/docs/maintainers/vcpkg_check_linkage.md @@ -1,5 +1,7 @@ # vcpkg_check_linkage +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_check_linkage.md). + Asserts the available library and CRT linkage options for the port. ## Usage @@ -33,4 +35,4 @@ This command will either alter the settings for `VCPKG_LIBRARY_LINKAGE` or fail, * [abseil](https://github.com/Microsoft/vcpkg/blob/master/ports/abseil/portfile.cmake) ## Source -[scripts/cmake/vcpkg_check_linkage.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_check_linkage.cmake) +[scripts/cmake/vcpkg\_check\_linkage.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_check_linkage.cmake) diff --git a/docs/maintainers/vcpkg_clean_executables_in_bin.md b/docs/maintainers/vcpkg_clean_executables_in_bin.md index 26f948cbc16895..518154642bb922 100644 --- a/docs/maintainers/vcpkg_clean_executables_in_bin.md +++ b/docs/maintainers/vcpkg_clean_executables_in_bin.md @@ -1,5 +1,7 @@ # vcpkg_clean_executables_in_bin +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_clean_executables_in_bin.md). + 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 @@ -20,4 +22,4 @@ Generally, there is no need to call this function manually. Instead, pass an ext * [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) +[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_clean_msbuild.md b/docs/maintainers/vcpkg_clean_msbuild.md index 1837bccbb7d88b..d835859745906a 100644 --- a/docs/maintainers/vcpkg_clean_msbuild.md +++ b/docs/maintainers/vcpkg_clean_msbuild.md @@ -1,5 +1,7 @@ # vcpkg_clean_msbuild +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_clean_msbuild.md). + Clean intermediate files generated by `vcpkg_install_msbuild()`. ## Usage @@ -12,4 +14,4 @@ vcpkg_clean_msbuild() * [xalan-c](https://github.com/Microsoft/vcpkg/blob/master/ports/xalan-c/portfile.cmake) ## Source -[scripts/cmake/vcpkg_clean_msbuild.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_clean_msbuild.cmake) +[scripts/cmake/vcpkg\_clean\_msbuild.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_clean_msbuild.cmake) diff --git a/docs/maintainers/vcpkg_common_definitions.md b/docs/maintainers/vcpkg_common_definitions.md index b93ef4cbdbe769..5809dda3477728 100644 --- a/docs/maintainers/vcpkg_common_definitions.md +++ b/docs/maintainers/vcpkg_common_definitions.md @@ -1,5 +1,7 @@ # vcpkg_common_definitions +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_common_definitions.md). + File contains helpful variabls for portfiles which are commonly needed or used. ## The following variables are available: @@ -25,4 +27,4 @@ Furthermore the variables CMAKE_FIND_LIBRARY_(PREFIXES|SUFFIXES) are also define portfiles are able to use find_library calls to discover dependent libraries within the current triplet for ports. ## Source -[scripts/cmake/vcpkg_common_definitions.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_common_definitions.cmake) +[scripts/cmake/vcpkg\_common\_definitions.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_common_definitions.cmake) diff --git a/docs/maintainers/vcpkg_configure_cmake.md b/docs/maintainers/vcpkg_configure_cmake.md index bd1a3156591c52..851b76dbcfcb22 100644 --- a/docs/maintainers/vcpkg_configure_cmake.md +++ b/docs/maintainers/vcpkg_configure_cmake.md @@ -1,5 +1,7 @@ # vcpkg_configure_cmake +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_configure_cmake.md). + Configure CMake for Debug and Release builds of a project. ## Usage @@ -65,4 +67,4 @@ This command supplies many common arguments to CMake. To see the full list, exam * [opencv](https://github.com/Microsoft/vcpkg/blob/master/ports/opencv/portfile.cmake) ## Source -[scripts/cmake/vcpkg_configure_cmake.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_configure_cmake.cmake) +[scripts/cmake/vcpkg\_configure\_cmake.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_configure_cmake.cmake) diff --git a/docs/maintainers/vcpkg_configure_gn.md b/docs/maintainers/vcpkg_configure_gn.md index 47742be5821d6b..e7a3ef35ce39a6 100644 --- a/docs/maintainers/vcpkg_configure_gn.md +++ b/docs/maintainers/vcpkg_configure_gn.md @@ -1,5 +1,7 @@ # vcpkg_configure_gn +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_configure_gn.md). + Generate Ninja (GN) targets ## Usage: @@ -27,4 +29,4 @@ Options to be passed to the debug target. Options to be passed to the release target. ## Source -[scripts/cmake/vcpkg_configure_gn.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_configure_gn.cmake) +[scripts/cmake/vcpkg\_configure\_gn.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_configure_gn.cmake) diff --git a/docs/maintainers/vcpkg_configure_make.md b/docs/maintainers/vcpkg_configure_make.md index fe18edd8b8f193..00d24f424b6235 100644 --- a/docs/maintainers/vcpkg_configure_make.md +++ b/docs/maintainers/vcpkg_configure_make.md @@ -1,5 +1,7 @@ # vcpkg_configure_make +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_configure_make.md). + Configure configure for Debug and Release builds of a project. ## Usage @@ -88,4 +90,4 @@ This command supplies many common arguments to configure. To see the full list, * [libosip2](https://github.com/Microsoft/vcpkg/blob/master/ports/libosip2/portfile.cmake) ## Source -[scripts/cmake/vcpkg_configure_make.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_configure_make.cmake) +[scripts/cmake/vcpkg\_configure\_make.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_configure_make.cmake) diff --git a/docs/maintainers/vcpkg_configure_meson.md b/docs/maintainers/vcpkg_configure_meson.md index 803ad0b170cde9..8b16812918d9ff 100644 --- a/docs/maintainers/vcpkg_configure_meson.md +++ b/docs/maintainers/vcpkg_configure_meson.md @@ -1,5 +1,7 @@ # vcpkg_configure_meson +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_configure_meson.md). + Configure Meson for Debug and Release builds of a project. ## Usage @@ -35,4 +37,4 @@ This command supplies many common arguments to Meson. To see the full list, exam * [libepoxy](https://github.com/Microsoft/vcpkg/blob/master/ports/libepoxy/portfile.cmake) ## Source -[scripts/cmake/vcpkg_configure_meson.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_configure_meson.cmake) +[scripts/cmake/vcpkg\_configure\_meson.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_configure_meson.cmake) diff --git a/docs/maintainers/vcpkg_configure_qmake.md b/docs/maintainers/vcpkg_configure_qmake.md index e55600c4e6a35e..e31aad814ea88a 100644 --- a/docs/maintainers/vcpkg_configure_qmake.md +++ b/docs/maintainers/vcpkg_configure_qmake.md @@ -1,5 +1,7 @@ # vcpkg_configure_qmake +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_configure_qmake.md). + Configure a qmake-based project. ```cmake @@ -18,4 +20,4 @@ The path to the *.pro qmake project file. The options passed to qmake. ## Source -[scripts/cmake/vcpkg_configure_qmake.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_configure_qmake.cmake) +[scripts/cmake/vcpkg\_configure\_qmake.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_configure_qmake.cmake) diff --git a/docs/maintainers/vcpkg_copy_pdbs.md b/docs/maintainers/vcpkg_copy_pdbs.md index 37592febcfc2a0..00332aef602e7c 100644 --- a/docs/maintainers/vcpkg_copy_pdbs.md +++ b/docs/maintainers/vcpkg_copy_pdbs.md @@ -1,5 +1,7 @@ # vcpkg_copy_pdbs +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_copy_pdbs.md). + Automatically locate pdbs in the build tree and copy them adjacent to all DLLs. ## Usage @@ -22,4 +24,4 @@ Defaults to `${CURRENT_PACKAGES_DIR}/bin/*.dll` and `${CURRENT_PACKAGES_DIR}/deb * [cpprestsdk](https://github.com/Microsoft/vcpkg/blob/master/ports/cpprestsdk/portfile.cmake) ## Source -[scripts/cmake/vcpkg_copy_pdbs.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_copy_pdbs.cmake) +[scripts/cmake/vcpkg\_copy\_pdbs.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_copy_pdbs.cmake) diff --git a/docs/maintainers/vcpkg_copy_tool_dependencies.md b/docs/maintainers/vcpkg_copy_tool_dependencies.md index 68b1fa09db25da..e6c046c55ff7d1 100644 --- a/docs/maintainers/vcpkg_copy_tool_dependencies.md +++ b/docs/maintainers/vcpkg_copy_tool_dependencies.md @@ -1,5 +1,7 @@ # vcpkg_copy_tool_dependencies +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_copy_tool_dependencies.md). + Copy all DLL dependencies of built tools into the tool folder. ## Usage @@ -18,4 +20,4 @@ This command should always be called by portfiles after they have finished rearr * [fltk](https://github.com/Microsoft/vcpkg/blob/master/ports/fltk/portfile.cmake) ## Source -[scripts/cmake/vcpkg_copy_tool_dependencies.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_copy_tool_dependencies.cmake) +[scripts/cmake/vcpkg\_copy\_tool\_dependencies.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_copy_tool_dependencies.cmake) diff --git a/docs/maintainers/vcpkg_copy_tools.md b/docs/maintainers/vcpkg_copy_tools.md index 5a3f886022f381..04c8c6bb5dca23 100644 --- a/docs/maintainers/vcpkg_copy_tools.md +++ b/docs/maintainers/vcpkg_copy_tools.md @@ -1,5 +1,7 @@ # vcpkg_copy_tools +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_copy_tools.md). + Copy tools and all their DLL dependencies into the `tools` folder. ## Usage @@ -27,4 +29,4 @@ Auto clean executables in `${CURRENT_PACKAGES_DIR}/bin` and `${CURRENT_PACKAGES_ * [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) +[scripts/cmake/vcpkg\_copy\_tools.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_copy_tools.cmake) diff --git a/docs/maintainers/vcpkg_download_distfile.md b/docs/maintainers/vcpkg_download_distfile.md index 0ff151739fd739..1e66adfd5664ee 100644 --- a/docs/maintainers/vcpkg_download_distfile.md +++ b/docs/maintainers/vcpkg_download_distfile.md @@ -1,5 +1,7 @@ # vcpkg_download_distfile +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_download_distfile.md). + Download and cache a file needed for this port. This helper should always be used instead of CMake's built-in `file(DOWNLOAD)` command. @@ -51,4 +53,4 @@ The helper [`vcpkg_from_github`](vcpkg_from_github.md) should be used for downlo * [freetype](https://github.com/Microsoft/vcpkg/blob/master/ports/freetype/portfile.cmake) ## Source -[scripts/cmake/vcpkg_download_distfile.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_download_distfile.cmake) +[scripts/cmake/vcpkg\_download\_distfile.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_download_distfile.cmake) diff --git a/docs/maintainers/vcpkg_execute_build_process.md b/docs/maintainers/vcpkg_execute_build_process.md index 1c81dd1b5613d9..ba491b8885a80e 100644 --- a/docs/maintainers/vcpkg_execute_build_process.md +++ b/docs/maintainers/vcpkg_execute_build_process.md @@ -1,5 +1,7 @@ # vcpkg_execute_build_process +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_execute_build_process.md). + Execute a required build process ## Usage @@ -33,4 +35,4 @@ conflict when building multiple at once. * [icu](https://github.com/Microsoft/vcpkg/blob/master/ports/icu/portfile.cmake) ## Source -[scripts/cmake/vcpkg_execute_build_process.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_execute_build_process.cmake) +[scripts/cmake/vcpkg\_execute\_build\_process.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_execute_build_process.cmake) diff --git a/docs/maintainers/vcpkg_execute_in_download_mode.md b/docs/maintainers/vcpkg_execute_in_download_mode.md index 50ea3786a23bce..c49d8a518435b5 100644 --- a/docs/maintainers/vcpkg_execute_in_download_mode.md +++ b/docs/maintainers/vcpkg_execute_in_download_mode.md @@ -1,5 +1,7 @@ # vcpkg_execute_in_download_mode +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_execute_in_download_mode.md). + Execute a process even in download mode. ## Usage @@ -31,4 +33,4 @@ See [`execute_process()`] for a detailed description of the parameters. [`execute_process()`]: https://cmake.org/cmake/help/latest/command/execute_process.html ## Source -[scripts/cmake/vcpkg_execute_in_download_mode.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_execute_in_download_mode.cmake) +[scripts/cmake/vcpkg\_execute\_in\_download\_mode.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_execute_in_download_mode.cmake) diff --git a/docs/maintainers/vcpkg_execute_required_process.md b/docs/maintainers/vcpkg_execute_required_process.md index 21b1029eb89555..aad010d5fad7ac 100644 --- a/docs/maintainers/vcpkg_execute_required_process.md +++ b/docs/maintainers/vcpkg_execute_required_process.md @@ -1,5 +1,7 @@ # vcpkg_execute_required_process +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_execute_required_process.md). + Execute a process with logging and fail the build if the command fails. ## Usage @@ -46,4 +48,4 @@ This should be a unique name for different triplets so that the logs don't confl * [qt5](https://github.com/Microsoft/vcpkg/blob/master/ports/qt5/portfile.cmake) ## Source -[scripts/cmake/vcpkg_execute_required_process.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_execute_required_process.cmake) +[scripts/cmake/vcpkg\_execute\_required\_process.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_execute_required_process.cmake) diff --git a/docs/maintainers/vcpkg_execute_required_process_repeat.md b/docs/maintainers/vcpkg_execute_required_process_repeat.md index 290ac7fce865a8..97f02eb3e1f12e 100644 --- a/docs/maintainers/vcpkg_execute_required_process_repeat.md +++ b/docs/maintainers/vcpkg_execute_required_process_repeat.md @@ -1,5 +1,7 @@ # vcpkg_execute_required_process_repeat +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_execute_required_process_repeat.md). + Execute a process until the command succeeds, or until the COUNT is reached. ## Usage @@ -13,4 +15,4 @@ vcpkg_execute_required_process_repeat( ``` ## Source -[scripts/cmake/vcpkg_execute_required_process_repeat.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_execute_required_process_repeat.cmake) +[scripts/cmake/vcpkg\_execute\_required\_process\_repeat.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_execute_required_process_repeat.cmake) diff --git a/docs/maintainers/vcpkg_extract_source_archive.md b/docs/maintainers/vcpkg_extract_source_archive.md index da98a2813eee9a..d7dc30c05eb65d 100644 --- a/docs/maintainers/vcpkg_extract_source_archive.md +++ b/docs/maintainers/vcpkg_extract_source_archive.md @@ -1,5 +1,7 @@ # vcpkg_extract_source_archive +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_extract_source_archive.md). + Extract an archive into the source directory. Deprecated in favor of [`vcpkg_extract_source_archive_ex`](vcpkg_extract_source_archive_ex.md). ## Usage @@ -29,4 +31,4 @@ This command will also create a tracking file named .extracted in the * [msgpack](https://github.com/Microsoft/vcpkg/blob/master/ports/msgpack/portfile.cmake) ## Source -[scripts/cmake/vcpkg_extract_source_archive.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_extract_source_archive.cmake) +[scripts/cmake/vcpkg\_extract\_source\_archive.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_extract_source_archive.cmake) diff --git a/docs/maintainers/vcpkg_extract_source_archive_ex.md b/docs/maintainers/vcpkg_extract_source_archive_ex.md index 55902b70d05c53..540cc687e825c9 100644 --- a/docs/maintainers/vcpkg_extract_source_archive_ex.md +++ b/docs/maintainers/vcpkg_extract_source_archive_ex.md @@ -1,5 +1,7 @@ # vcpkg_extract_source_archive_ex +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_extract_source_archive_ex.md). + Extract an archive into the source directory. Replaces [`vcpkg_extract_source_archive`](vcpkg_extract_source_archive.md). ## Usage @@ -53,4 +55,4 @@ Specifies that the default removal of the top level folder should not occur. * [cairo](https://github.com/Microsoft/vcpkg/blob/master/ports/cairo/portfile.cmake) ## Source -[scripts/cmake/vcpkg_extract_source_archive_ex.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_extract_source_archive_ex.cmake) +[scripts/cmake/vcpkg\_extract\_source\_archive\_ex.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_extract_source_archive_ex.cmake) diff --git a/docs/maintainers/vcpkg_fail_port_install.md b/docs/maintainers/vcpkg_fail_port_install.md index 53b81bd1a433b9..9be31ce509f92b 100644 --- a/docs/maintainers/vcpkg_fail_port_install.md +++ b/docs/maintainers/vcpkg_fail_port_install.md @@ -1,5 +1,7 @@ # vcpkg_fail_port_install +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_fail_port_install.md). + Checks common requirements and fails the current portfile with a (default) error message ## Usage @@ -38,4 +40,4 @@ Library linkage for which the build should fail early. * [aws-lambda-cpp](https://github.com/Microsoft/vcpkg/blob/master/ports/aws-lambda-cpp/portfile.cmake) ## Source -[scripts/cmake/vcpkg_fail_port_install.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_fail_port_install.cmake) +[scripts/cmake/vcpkg\_fail\_port\_install.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_fail_port_install.cmake) diff --git a/docs/maintainers/vcpkg_find_acquire_program.md b/docs/maintainers/vcpkg_find_acquire_program.md index 2bdbb7c513deac..303508000e4cc8 100644 --- a/docs/maintainers/vcpkg_find_acquire_program.md +++ b/docs/maintainers/vcpkg_find_acquire_program.md @@ -1,5 +1,7 @@ # vcpkg_find_acquire_program +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_find_acquire_program.md). + Download or find a well-known tool. ## Usage @@ -46,4 +48,4 @@ Note that msys2 has a dedicated helper function: [`vcpkg_acquire_msys`](vcpkg_ac * [qt5](https://github.com/Microsoft/vcpkg/blob/master/ports/qt5/portfile.cmake) ## Source -[scripts/cmake/vcpkg_find_acquire_program.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_find_acquire_program.cmake) +[scripts/cmake/vcpkg\_find\_acquire\_program.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_find_acquire_program.cmake) diff --git a/docs/maintainers/vcpkg_find_fortran.md b/docs/maintainers/vcpkg_find_fortran.md index ffc1b6893cd710..004c3b443e2311 100644 --- a/docs/maintainers/vcpkg_find_fortran.md +++ b/docs/maintainers/vcpkg_find_fortran.md @@ -1,5 +1,7 @@ # vcpkg_find_fortran +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_find_fortran.md). + Checks if a Fortran compiler can be found. Windows(x86/x64) Only: If not it will switch/enable MinGW gfortran and return required cmake args for building. @@ -10,4 +12,4 @@ vcpkg_find_fortran() ``` ## Source -[scripts/cmake/vcpkg_find_fortran.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_find_fortran.cmake) +[scripts/cmake/vcpkg\_find\_fortran.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_find_fortran.cmake) diff --git a/docs/maintainers/vcpkg_fixup_cmake_targets.md b/docs/maintainers/vcpkg_fixup_cmake_targets.md index 01e4fd3e1ee819..a7914841626187 100644 --- a/docs/maintainers/vcpkg_fixup_cmake_targets.md +++ b/docs/maintainers/vcpkg_fixup_cmake_targets.md @@ -1,5 +1,7 @@ # vcpkg_fixup_cmake_targets +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_fixup_cmake_targets.md). + Merge release and debug CMake targets and configs to support multiconfig generators. Additionally corrects common issues with targets, such as absolute paths and incorrectly placed binaries. @@ -49,4 +51,4 @@ Replace `${CURRENT_INSTALLED_DIR}` with `${_IMPORT_PREFIX}` in configs and targe * [nlohmann-json](https://github.com/Microsoft/vcpkg/blob/master/ports/nlohmann-json/portfile.cmake) ## Source -[scripts/cmake/vcpkg_fixup_cmake_targets.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_fixup_cmake_targets.cmake) +[scripts/cmake/vcpkg\_fixup\_cmake\_targets.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_fixup_cmake_targets.cmake) diff --git a/docs/maintainers/vcpkg_fixup_pkgconfig.md b/docs/maintainers/vcpkg_fixup_pkgconfig.md index 23cee61429fb84..ce2a4391b1fb06 100644 --- a/docs/maintainers/vcpkg_fixup_pkgconfig.md +++ b/docs/maintainers/vcpkg_fixup_pkgconfig.md @@ -1,5 +1,7 @@ # vcpkg_fixup_pkgconfig +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_fixup_pkgconfig.md). + Fix common paths in *.pc files and make everything relativ to $(prefix) ## Usage @@ -40,4 +42,4 @@ Still work in progress. If there are more cases which can be handled here feel f * [brotli](https://github.com/Microsoft/vcpkg/blob/master/ports/brotli/portfile.cmake) ## Source -[scripts/cmake/vcpkg_fixup_pkgconfig.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_fixup_pkgconfig.cmake) +[scripts/cmake/vcpkg\_fixup\_pkgconfig.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_fixup_pkgconfig.cmake) diff --git a/docs/maintainers/vcpkg_from_bitbucket.md b/docs/maintainers/vcpkg_from_bitbucket.md index ad41a14311a97c..f91040e2156cdb 100644 --- a/docs/maintainers/vcpkg_from_bitbucket.md +++ b/docs/maintainers/vcpkg_from_bitbucket.md @@ -1,5 +1,7 @@ # vcpkg_from_bitbucket +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_from_bitbucket.md). + Download and extract a project from Bitbucket. Enables support for installing HEAD `vcpkg.exe install --head `. @@ -56,4 +58,4 @@ This exports the `VCPKG_HEAD_VERSION` variable during head builds. * [blaze](https://github.com/Microsoft/vcpkg/blob/master/ports/blaze/portfile.cmake) ## Source -[scripts/cmake/vcpkg_from_bitbucket.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_from_bitbucket.cmake) +[scripts/cmake/vcpkg\_from\_bitbucket.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_from_bitbucket.cmake) diff --git a/docs/maintainers/vcpkg_from_git.md b/docs/maintainers/vcpkg_from_git.md index ac8ad68407a856..0d24aa76f85d0d 100644 --- a/docs/maintainers/vcpkg_from_git.md +++ b/docs/maintainers/vcpkg_from_git.md @@ -1,5 +1,7 @@ # vcpkg_from_git +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_from_git.md). + Download and extract a project from git ## Usage: @@ -44,4 +46,4 @@ This parameter is used for automatic REF updates for certain ports in the centra * [fdlibm](https://github.com/Microsoft/vcpkg/blob/master/ports/fdlibm/portfile.cmake) ## Source -[scripts/cmake/vcpkg_from_git.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_from_git.cmake) +[scripts/cmake/vcpkg\_from\_git.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_from_git.cmake) diff --git a/docs/maintainers/vcpkg_from_github.md b/docs/maintainers/vcpkg_from_github.md index db557c1c886949..cfd28c6a7b7a44 100644 --- a/docs/maintainers/vcpkg_from_github.md +++ b/docs/maintainers/vcpkg_from_github.md @@ -1,5 +1,7 @@ # vcpkg_from_github +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_from_github.md). + Download and extract a project from GitHub. Enables support for `install --head`. ## Usage: @@ -71,4 +73,4 @@ This exports the `VCPKG_HEAD_VERSION` variable during head builds. * [beast](https://github.com/Microsoft/vcpkg/blob/master/ports/beast/portfile.cmake) ## Source -[scripts/cmake/vcpkg_from_github.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_from_github.cmake) +[scripts/cmake/vcpkg\_from\_github.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_from_github.cmake) diff --git a/docs/maintainers/vcpkg_from_gitlab.md b/docs/maintainers/vcpkg_from_gitlab.md index e2160b27b5dd97..c222aa88df0ab5 100644 --- a/docs/maintainers/vcpkg_from_gitlab.md +++ b/docs/maintainers/vcpkg_from_gitlab.md @@ -1,5 +1,7 @@ # vcpkg_from_gitlab +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_from_gitlab.md). + Download and extract a project from Gitlab instances. Enables support for `install --head`. ## Usage: @@ -66,4 +68,4 @@ This exports the `VCPKG_HEAD_VERSION` variable during head builds. * [z3](https://github.com/Microsoft/vcpkg/blob/master/ports/z3/portfile.cmake#L13) ## Source -[scripts/cmake/vcpkg_from_gitlab.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_from_gitlab.cmake) +[scripts/cmake/vcpkg\_from\_gitlab.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_from_gitlab.cmake) diff --git a/docs/maintainers/vcpkg_from_sourceforge.md b/docs/maintainers/vcpkg_from_sourceforge.md index 2bf7f25a6e7fe8..2f34e076631b46 100644 --- a/docs/maintainers/vcpkg_from_sourceforge.md +++ b/docs/maintainers/vcpkg_from_sourceforge.md @@ -1,5 +1,7 @@ # vcpkg_from_sourceforge +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_from_sourceforge.md). + Download and extract a project from sourceforge. ## Usage: @@ -65,4 +67,4 @@ Specifies that the default removal of the top level folder should not occur. * [tinyfiledialogs](https://github.com/Microsoft/vcpkg/blob/master/ports/tinyfiledialogs/portfile.cmake) ## Source -[scripts/cmake/vcpkg_from_sourceforge.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_from_sourceforge.cmake) +[scripts/cmake/vcpkg\_from\_sourceforge.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_from_sourceforge.cmake) diff --git a/docs/maintainers/vcpkg_get_program_files_platform_bitness.md b/docs/maintainers/vcpkg_get_program_files_platform_bitness.md index d4d5480d07913f..653627fed63a53 100644 --- a/docs/maintainers/vcpkg_get_program_files_platform_bitness.md +++ b/docs/maintainers/vcpkg_get_program_files_platform_bitness.md @@ -1,5 +1,7 @@ # vcpkg_get_program_files_platform_bitness +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_get_program_files_platform_bitness.md). + Get the Program Files directory of the current platform's bitness: either `$ENV{ProgramW6432}` on 64-bit windows, or `$ENV{PROGRAMFILES}` on 32-bit windows. @@ -10,4 +12,4 @@ vcpkg_get_program_files_platform_bitness() ``` ## Source -[scripts/cmake/vcpkg_get_program_files_platform_bitness.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_get_program_files_platform_bitness.cmake) +[scripts/cmake/vcpkg\_get\_program\_files\_platform\_bitness.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_get_program_files_platform_bitness.cmake) diff --git a/docs/maintainers/vcpkg_get_windows_sdk.md b/docs/maintainers/vcpkg_get_windows_sdk.md index 30cac43de6495a..d8fdb8a8bbb9fa 100644 --- a/docs/maintainers/vcpkg_get_windows_sdk.md +++ b/docs/maintainers/vcpkg_get_windows_sdk.md @@ -1,5 +1,7 @@ # vcpkg_get_windows_sdk +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_get_windows_sdk.md). + Get the Windows SDK number. ## Usage: @@ -8,4 +10,4 @@ vcpkg_get_windows_sdk() ``` ## Source -[scripts/cmake/vcpkg_get_windows_sdk.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_get_windows_sdk.cmake) +[scripts/cmake/vcpkg\_get\_windows\_sdk.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_get_windows_sdk.cmake) diff --git a/docs/maintainers/vcpkg_install_cmake.md b/docs/maintainers/vcpkg_install_cmake.md index 058a2ef61f3cb8..d6433cd7cd10a0 100644 --- a/docs/maintainers/vcpkg_install_cmake.md +++ b/docs/maintainers/vcpkg_install_cmake.md @@ -1,5 +1,7 @@ # vcpkg_install_cmake +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_install_cmake.md). + Build and install a cmake project. ## Usage: @@ -22,4 +24,4 @@ parameter. * [opencv](https://github.com/Microsoft/vcpkg/blob/master/ports/opencv/portfile.cmake) ## Source -[scripts/cmake/vcpkg_install_cmake.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_install_cmake.cmake) +[scripts/cmake/vcpkg\_install\_cmake.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_install_cmake.cmake) diff --git a/docs/maintainers/vcpkg_install_gn.md b/docs/maintainers/vcpkg_install_gn.md index 48bd81a02d4fe9..651b3f8f70965c 100644 --- a/docs/maintainers/vcpkg_install_gn.md +++ b/docs/maintainers/vcpkg_install_gn.md @@ -1,5 +1,7 @@ # vcpkg_install_gn +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_install_gn.md). + Installs a GN project ## Usage: @@ -20,4 +22,4 @@ Only install the specified targets. Note: includes must be handled separately ## Source -[scripts/cmake/vcpkg_install_gn.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_install_gn.cmake) +[scripts/cmake/vcpkg\_install\_gn.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_install_gn.cmake) diff --git a/docs/maintainers/vcpkg_install_make.md b/docs/maintainers/vcpkg_install_make.md index c1baa36395025c..2643db4134619e 100644 --- a/docs/maintainers/vcpkg_install_make.md +++ b/docs/maintainers/vcpkg_install_make.md @@ -1,5 +1,7 @@ # vcpkg_install_make +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_install_make.md). + Build and install a make project. ## Usage: @@ -21,4 +23,4 @@ This command transparently forwards to [`vcpkg_build_make()`](vcpkg_build_make.m * [libosip2](https://github.com/Microsoft/vcpkg/blob/master/ports/libosip2/portfile.cmake) ## Source -[scripts/cmake/vcpkg_install_make.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_install_make.cmake) +[scripts/cmake/vcpkg\_install\_make.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_install_make.cmake) diff --git a/docs/maintainers/vcpkg_install_meson.md b/docs/maintainers/vcpkg_install_meson.md index 8d8cc5bb01b501..2967dd989d8a03 100644 --- a/docs/maintainers/vcpkg_install_meson.md +++ b/docs/maintainers/vcpkg_install_meson.md @@ -1,5 +1,7 @@ # vcpkg_install_meson +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_install_meson.md). + Builds a meson project previously configured with `vcpkg_configure_meson()`. ## Usage @@ -13,4 +15,4 @@ vcpkg_install_meson() * [libepoxy](https://github.com/Microsoft/vcpkg/blob/master/ports/libepoxy/portfile.cmake) ## Source -[scripts/cmake/vcpkg_install_meson.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_install_meson.cmake) +[scripts/cmake/vcpkg\_install\_meson.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_install_meson.cmake) diff --git a/docs/maintainers/vcpkg_install_msbuild.md b/docs/maintainers/vcpkg_install_msbuild.md index 65da246678a59e..befb2951329e33 100644 --- a/docs/maintainers/vcpkg_install_msbuild.md +++ b/docs/maintainers/vcpkg_install_msbuild.md @@ -1,5 +1,7 @@ # vcpkg_install_msbuild +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_install_msbuild.md). + Build and install a msbuild-based project. This replaces `vcpkg_build_msbuild()`. ## Usage @@ -90,4 +92,4 @@ Additional options passed to msbuild for Debug builds. These are in addition to * [libimobiledevice](https://github.com/Microsoft/vcpkg/blob/master/ports/libimobiledevice/portfile.cmake) ## Source -[scripts/cmake/vcpkg_install_msbuild.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_install_msbuild.cmake) +[scripts/cmake/vcpkg\_install\_msbuild.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_install_msbuild.cmake) diff --git a/docs/maintainers/vcpkg_install_nmake.md b/docs/maintainers/vcpkg_install_nmake.md index f4f490b2ba61df..0855497ca2e904 100644 --- a/docs/maintainers/vcpkg_install_nmake.md +++ b/docs/maintainers/vcpkg_install_nmake.md @@ -1,5 +1,7 @@ # vcpkg_install_nmake +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_install_nmake.md). + Build and install a msvc makefile project. ## Usage: @@ -63,4 +65,4 @@ This command transparently forwards to [`vcpkg_build_nmake()`](vcpkg_build_nmake * [freexl](https://github.com/Microsoft/vcpkg/blob/master/ports/freexl/portfile.cmake) ## Source -[scripts/cmake/vcpkg_install_nmake.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_install_nmake.cmake) +[scripts/cmake/vcpkg\_install\_nmake.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_install_nmake.cmake) diff --git a/docs/maintainers/vcpkg_install_qmake.md b/docs/maintainers/vcpkg_install_qmake.md index 51421247b26d16..102a642ece8243 100644 --- a/docs/maintainers/vcpkg_install_qmake.md +++ b/docs/maintainers/vcpkg_install_qmake.md @@ -1,5 +1,7 @@ # vcpkg_install_qmake +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_install_qmake.md). + Build and install a qmake project. ## Usage: @@ -21,4 +23,4 @@ staging directories. * [libqglviewer](https://github.com/Microsoft/vcpkg/blob/master/ports/libqglviewer/portfile.cmake) ## Source -[scripts/cmake/vcpkg_install_qmake.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_install_qmake.cmake) +[scripts/cmake/vcpkg\_install\_qmake.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_install_qmake.cmake) diff --git a/docs/maintainers/vcpkg_minimum_required.md b/docs/maintainers/vcpkg_minimum_required.md index 419338956286c2..aaeee5cbf20696 100644 --- a/docs/maintainers/vcpkg_minimum_required.md +++ b/docs/maintainers/vcpkg_minimum_required.md @@ -1,5 +1,7 @@ # vcpkg_minimum_required +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_minimum_required.md). + Asserts that the version of the vcpkg program being used to build a port is later than the supplied date, inclusive. ## Usage @@ -12,4 +14,4 @@ vcpkg_minimum_required(VERSION 2021-01-13) The date-version to check against. ## Source -[scripts/cmake/vcpkg_minimum_required.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_minimum_required.cmake) +[scripts/cmake/vcpkg\_minimum\_required.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_minimum_required.cmake) diff --git a/docs/maintainers/vcpkg_replace_string.md b/docs/maintainers/vcpkg_replace_string.md index 9269609859c81b..de223c40c61808 100644 --- a/docs/maintainers/vcpkg_replace_string.md +++ b/docs/maintainers/vcpkg_replace_string.md @@ -1,5 +1,7 @@ # vcpkg_replace_string +The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/maintainers/vcpkg_replace_string.md). + Replace a string in a file. ```cmake @@ -8,4 +10,4 @@ vcpkg_replace_string(filename match_string replace_string) ## Source -[scripts/cmake/vcpkg_replace_string.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_replace_string.cmake) +[scripts/cmake/vcpkg\_replace\_string.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_replace_string.cmake) diff --git a/docs/regenerate.ps1 b/docs/regenerate.ps1 index fa80bd62ab5a90..f1fa695fbc8f78 100755 --- a/docs/regenerate.ps1 +++ b/docs/regenerate.ps1 @@ -15,9 +15,71 @@ if (-not (Test-Path "$VcpkgRoot/.vcpkg-root")) { throw "Invalid vcpkg instance, did you forget -VcpkgRoot?" } -$tableOfContents = @() -$internalTableOfContents = @() +class CMakeDocumentation { + [String]$Filename + [String[]]$ActualDocumentation + [Bool]$IsDeprecated + [String]$DeprecationMessage + [Bool]$HasError +} + +[String[]]$cmakeScriptsPorts = @( +) + +[CMakeDocumentation[]]$tableOfContents = @() +[CMakeDocumentation[]]$internalTableOfContents = @() +$portTableOfContents = [ordered]@{} + +function RelativeUnixPathTo +{ + Param( + [Parameter(Mandatory)] + [String]$Path, + [Parameter(Mandatory)] + [String]$Base + ) + + $Path = Resolve-Path -LiteralPath $Path + $Base = Resolve-Path -LiteralPath $Base + + if ($IsWindows) + { + if ((Split-Path -Qualifier $Path) -ne (Split-Path -Qualifier $Base)) + { + throw "It is not possible to get the relative unix path from $Base to $Path" + } + } + + $Path = $Path -replace '\\','/' + $Base = $Base -replace '\\','/' + + [String[]]$PathArray = $Path -split '/' + [String[]]$BaseArray = $Base -split '/' + + [String[]]$Result = @() + + $Idx = 0 + + while ($Idx -lt $PathArray.Length -and $Idx -lt $BaseArray.Length) + { + if ($PathArray[$Idx] -ne $BaseArray[$Idx]) + { + break + } + ++$Idx + } + + for ($BaseIdx = $Idx; $BaseIdx -lt $BaseArray.Length; ++$BaseIdx) + { + $Result += '..' + } + for ($PathIdx = $Idx; $PathIdx -lt $PathArray.Length; ++$PathIdx) + { + $Result += $PathArray[$PathIdx] + } + $Result -join '/' +} function WriteFile { Param( @@ -33,41 +95,81 @@ function WriteFile function FinalDocFile { Param( - [String[]]$Value, - [String]$Name + [CMakeDocumentation]$Docs, + [String]$PathToFile # something like docs/maintainers/blah.md ) - $Value + @( + [String[]]$documentation = @() + + if ($Docs.ActualDocumentation.Length -eq 0) + { + throw "Invalid documentation: empty docs" + } + + $documentation += $Docs.ActualDocumentation[0] # name line + if ($Docs.IsDeprecated) + { + if ($null -eq $Docs.DeprecationMessage) + { + $documentation += @("", "**This function has been deprecated**") + } + else + { + $documentation += @("", "**This function has been deprecated $($Docs.DeprecationMessage)**") + } + } + $documentation += @("", "The latest version of this document lives in the [vcpkg repo](https://github.com/Microsoft/vcpkg/blob/master/$PathToFile).") + + $documentation += $Docs.ActualDocumentation[1..$Docs.ActualDocumentation.Length] + + $relativePath = RelativeUnixPathTo $Docs.Filename $VcpkgRoot + $documentation += @( "", "## Source", - "[scripts/cmake/$Name](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/$Name)", + "[$($relativePath -replace '_','\_')](https://github.com/Microsoft/vcpkg/blob/master/$relativePath)", "" ) + + $documentation } -Get-ChildItem "$VcpkgRoot/scripts/cmake" -Filter '*.cmake' | ForEach-Object { - $filename = $_ - [String[]]$contents = Get-Content $filename +function ParseCmakeDocComment +{ + Param( + [Parameter(Mandatory)] + [System.IO.FileSystemInfo]$Filename + ) - if ($contents[0] -eq '# DEPRECATED') { - return + $Docs = New-Object 'CMakeDocumentation' + $Docs.HasError = $False + $Docs.IsDeprecated = $False + $Docs.Filename = $Filename.FullName + + [String[]]$contents = Get-Content $Filename + + if ($contents[0] -eq '# DEPRECATED') + { + $Docs.IsDeprecated = $True + } + elseif($contents[0] -match '^# DEPRECATED: (.*)$') + { + $Docs.IsDeprecated = $True + $Docs.DeprecationMessage = $matches[1] } [String]$startCommentRegex = '#\[(=*)\[' [String]$endCommentRegex = '' [Bool]$inComment = $False - [Bool]$failThisFile = $False - [Bool]$isInternalFunction = $filename.Name.StartsWith("vcpkg_internal") -or $filename.Name.StartsWith("z_vcpkg") $contents = $contents | ForEach-Object { if (-not $inComment) { if ($_ -match "^\s*${startCommentRegex}(\.[a-z]*)?:?\s*$") { if (-not [String]::IsNullOrEmpty($matches[2]) -and $matches[2] -ne '.md') { - Write-Warning "The documentation in ${filename} doesn't seem to be markdown (extension: $($matches[2])). Only markdown is supported; please rewrite the documentation in markdown." + Write-Warning "The documentation in $($Filename.FullName) doesn't seem to be markdown (extension: $($matches[2])). Only markdown is supported; please rewrite the documentation in markdown." } $inComment = $True $endCommentRegex = "\]$($matches[1])\]" } elseif ($_ -match $startCommentRegex) { - $failThisFile = $True + $Docs.HasError = $True Write-Warning "Invalid start of comment -- the comment start must be at the beginning of the line. (on line: `"$_`")" } else { @@ -78,7 +180,7 @@ Get-ChildItem "$VcpkgRoot/scripts/cmake" -Filter '*.cmake' | ForEach-Object { $inComment = $False $endCommentRegex = '' } elseif ($_ -match $endCommentRegex) { - $failThisFile = $True + $Docs.HasError = $True Write-Warning "Invalid end of comment -- the comment end must be on it's own on a line. (on line: `"$_`")" } else { @@ -89,47 +191,147 @@ Get-ChildItem "$VcpkgRoot/scripts/cmake" -Filter '*.cmake' | ForEach-Object { } if ($inComment) { - Write-Warning "File ${filename} has an unclosed comment." - return + Write-Warning "File $($Filename.FullName) has an unclosed comment." + $Docs.HasError = $True } - if ($failThisFile) { - return + if ($contents.Length -ne 0) + { + $Docs.ActualDocumentation = $contents } + $Docs +} + +Get-ChildItem "$VcpkgRoot/scripts/cmake" -Filter '*.cmake' | ForEach-Object { + $docs = ParseCmakeDocComment $_ + [Bool]$isInternalFunction = $_.Name.StartsWith("vcpkg_internal") -or $_.Name.StartsWith("z_vcpkg") + + if ($docs.IsDeprecated -and $null -eq $docs.ActualDocumentation) + { + return + } + if ($docs.HasError) + { + return + } - if ($contents) { - if ($isInternalFunction) { + if ($null -ne $docs.ActualDocumentation) + { + if ($isInternalFunction) + { + $pathToFile = "maintainers/internal/$($_.BaseName).md" WriteFile ` - -Path "$PSScriptRoot/maintainers/internal/$($filename.BaseName).md" ` - -Value (FinalDocFile $contents $filename.Name) + -Path "$PSScriptRoot/$pathToFile" ` + -Value (FinalDocFile $docs) - $internalTableOfContents += $filename.BaseName - } else { + $internalTableOfContents += $docs + } + else + { + $pathToFile = "maintainers/$($_.BaseName).md" WriteFile ` - -Path "$PSScriptRoot/maintainers/$($filename.BaseName).md" ` - -Value (FinalDocFile $contents $filename.Name) + -Path "$PSScriptRoot/$pathToFile" ` + -Value (FinalDocFile $docs $pathToFile) - $tableOfContents += $filename.BaseName + $tableOfContents += $docs } - } elseif (-not $isInternalFunction) { + } + elseif (-not $isInternalFunction) + { # don't worry about undocumented internal functions - Write-Warning "The cmake function in file $filename doesn't seem to have any documentation. Make sure the documentation comments are correctly written." + Write-Warning "The cmake function in file $($_.FullName) doesn't seem to have any documentation. Make sure the documentation comments are correctly written." + } +} + +$cmakeScriptsPorts | ForEach-Object { + $portName = $_ + + Copy-Item "$VcpkgRoot/ports/$portName/README.md" "$PSScriptRoot/maintainers/ports/$portName.md" + New-Item -Path "$PSScriptRoot/maintainers/ports/$portName" -Force -ItemType 'Directory' | Out-Null + + $portTableOfContents[$portName] = @() + + Get-ChildItem "$VcpkgRoot/ports/$portName" -Filter '*.cmake' | ForEach-Object { + if ($_.Name -eq 'vcpkg-port-config.cmake' -or $_.Name -eq 'portfile.cmake') + { + return + } + + $docs = ParseCmakeDocComment $_ + + if ($docs.IsDeprecated -and $null -eq $docs.ActualDocumentation) + { + return + } + if ($docs.HasError) + { + return + } + + if ($null -ne $docs.ActualDocumentation) + { + $pathToFile = "maintainers/ports/$portName/$($_.BaseName).md" + WriteFile ` + -Path "$PSScriptRoot/$pathToFile" ` + -Value (FinalDocFile $docs $pathToFile) + $portTableOfContents[$portName] += $docs + } + else + { + Write-Warning "The cmake function in file $($_.FullName) doesn't seem to have any documentation. Make sure the documentation comments are correctly written." + } } } $portfileFunctionsContent = @( - '', + '', '', '# Portfile helper functions') -$tableOfContents | Sort-Object -Culture '' | ForEach-Object { - $portfileFunctionsContent += "- [$($_ -replace '_','\_')]($_.md)" +$DocsName = @{ expression = { Split-Path -LeafBase $_.Filename } } +$tableOfContents | Sort-Object -Property $DocsName -Culture '' | ForEach-Object { + $name = Split-Path -LeafBase $_.Filename + if ($_.IsDeprecated) + { + $portfileFunctionsContent += "- [$($name -replace '_','\_')]($name.md) (deprecated)" + } + else + { + $portfileFunctionsContent += "- [$($name -replace '_','\_')]($name.md)" + } } $portfileFunctionsContent += @("", "## Internal Functions", "") -$internalTableOfContents | Sort-Object -Culture '' | ForEach-Object { - $portfileFunctionsContent += "- [$($_ -replace '_','\_')](internal/$_.md)" +$internalTableOfContents | Sort-Object -Property $DocsName -Culture '' | ForEach-Object { + $name = Split-Path -LeafBase $_.Filename + if ($_.IsDeprecated) + { + $portfileFunctionsContent += "- [$($name -replace '_','\_')](internal/$name.md) (deprecated)" + } + else + { + $portfileFunctionsContent += "- [$($name -replace '_','\_')](internal/$name.md)" + } } + +$portfileFunctionsContent += @("", "## Scripts from Ports") +$portTableOfContents.GetEnumerator() | ForEach-Object { + $portName = $_.Name + $cmakeDocs = $_.Value + $portfileFunctionsContent += @("", "### [$portName](ports/$portName.md)", "") + $cmakeDocs | ForEach-Object { + $name = Split-Path -LeafBase $_.Filename + if ($_.IsDeprecated) + { + $portfileFunctionsContent += "- [$($name -replace '_','\_')](ports/$portName/$name.md) (deprecated)" + } + else + { + $portfileFunctionsContent += "- [$($name -replace '_','\_')](ports/$portName/$name.md)" + } + } +} + $portfileFunctionsContent += "" # final newline WriteFile ` diff --git a/scripts/cmake/vcpkg_apply_patches.cmake b/scripts/cmake/vcpkg_apply_patches.cmake index b2e2263511241e..bd4325af4f9fe7 100644 --- a/scripts/cmake/vcpkg_apply_patches.cmake +++ b/scripts/cmake/vcpkg_apply_patches.cmake @@ -1,9 +1,10 @@ +# DEPRECATED: in favor of the `PATCHES` argument to `vcpkg_from_github()` et al. + #[===[.md # vcpkg_apply_patches -Apply a set of patches to a source tree. This function is deprecated in favor of the `PATCHES` argument to `vcpkg_from_github()` et al. +Apply a set of patches to a source tree. -## Usage ```cmake vcpkg_apply_patches( SOURCE_PATH <${SOURCE_PATH}> @@ -11,63 +12,22 @@ vcpkg_apply_patches( PATCHES ... ) ``` - -## Parameters -### SOURCE_PATH -The source path in which apply the patches. By convention, this is usually set in the portfile as the variable `SOURCE_PATH`. - -### PATCHES -A list of patches that are applied to the source tree. - -Generally, these take the form of `${CMAKE_CURRENT_LIST_DIR}/some.patch` to select patches in the `port\\` directory. - -### QUIET -Disables the warning message upon failure. - -This should only be used for edge cases, such as patches that are known to fail even on a clean source tree. - -## Examples - -* [libbson](https://github.com/Microsoft/vcpkg/blob/master/ports/libbson/portfile.cmake) -* [gdal](https://github.com/Microsoft/vcpkg/blob/master/ports/gdal/portfile.cmake) #]===] -include(vcpkg_execute_in_download_mode) - function(vcpkg_apply_patches) - # parse parameters such that semicolons in options arguments to COMMAND don't get erased - cmake_parse_arguments(PARSE_ARGV 0 _ap "QUIET" "SOURCE_PATH" "PATCHES") - - find_program(GIT NAMES git git.cmd) - if(DEFINED ENV{GIT_CONFIG_NOSYSTEM}) - set(GIT_CONFIG_NOSYSTEM_BACKUP "$ENV{GIT_CONFIG_NOSYSTEM}") - else() - unset(GIT_CONFIG_NOSYSTEM_BACKUP) - endif() - set(ENV{GIT_CONFIG_NOSYSTEM} 1) - set(PATCHNUM 0) - foreach(PATCH ${_ap_PATCHES}) - get_filename_component(ABSOLUTE_PATCH "${PATCH}" ABSOLUTE BASE_DIR "${CURRENT_PORT_DIR}") - message(STATUS "Applying patch ${PATCH}") - set(LOGNAME patch-${TARGET_TRIPLET}-${PATCHNUM}) - vcpkg_execute_in_download_mode( - COMMAND ${GIT} -c core.longpaths=true -c core.autocrlf=false --work-tree=. --git-dir=.git apply "${ABSOLUTE_PATCH}" --ignore-whitespace --whitespace=nowarn --verbose - OUTPUT_FILE ${CURRENT_BUILDTREES_DIR}/${LOGNAME}-out.log - ERROR_VARIABLE error - WORKING_DIRECTORY ${_ap_SOURCE_PATH} - RESULT_VARIABLE error_code - ) - file(WRITE "${CURRENT_BUILDTREES_DIR}/${LOGNAME}-err.log" "${error}") + z_vcpkg_deprecation_message("vcpkg_apply_patches has been deprecated in favor of the `PATCHES` argument to `vcpkg_from_*`.") - if(error_code AND NOT _ap_QUIET) - message(FATAL_ERROR "Applying patch failed. ${error}") - endif() + cmake_parse_arguments(PARSE_ARGV 0 "arg" "QUIET" "SOURCE_PATH" "PATCHES") - math(EXPR PATCHNUM "${PATCHNUM}+1") - endforeach() - if(DEFINED GIT_CONFIG_NOSYSTEM_BACKUP) - set(ENV{GIT_CONFIG_NOSYSTEM} "${GIT_CONFIG_NOSYSTEM_BACKUP}") + if(arg_QUIET) + set(quiet "QUIET") else() - unset(ENV{GIT_CONFIG_NOSYSTEM}) + set(quiet) endif() + + z_vcpkg_apply_patches( + SOURCE_PATH "${arg_SOURCE_PATH}" + ${quiet} + PATCHES ${arg_PATCHES} + ) endfunction() diff --git a/scripts/cmake/vcpkg_extract_source_archive_ex.cmake b/scripts/cmake/vcpkg_extract_source_archive_ex.cmake index bef245b5acea7d..633b40b1aec571 100644 --- a/scripts/cmake/vcpkg_extract_source_archive_ex.cmake +++ b/scripts/cmake/vcpkg_extract_source_archive_ex.cmake @@ -54,7 +54,6 @@ Specifies that the default removal of the top level folder should not occur. * [cairo](https://github.com/Microsoft/vcpkg/blob/master/ports/cairo/portfile.cmake) #]===] -include(vcpkg_apply_patches) include(vcpkg_extract_source_archive) function(vcpkg_extract_source_archive_ex) @@ -142,7 +141,7 @@ function(vcpkg_extract_source_archive_ex) set (QUIET) endif() - vcpkg_apply_patches( + z_vcpkg_apply_patches( ${QUIET} SOURCE_PATH ${TEMP_SOURCE_PATH} PATCHES ${_vesae_PATCHES} diff --git a/scripts/cmake/z_vcpkg_apply_patches.cmake b/scripts/cmake/z_vcpkg_apply_patches.cmake new file mode 100644 index 00000000000000..3f91757490e5c4 --- /dev/null +++ b/scripts/cmake/z_vcpkg_apply_patches.cmake @@ -0,0 +1,67 @@ +#[===[.md: +# z_vcpkg_apply_patches + +**Only for internal use in vcpkg helpers. Behavior and arguments will change without notice.** + +Apply a set of patches to a source tree. + +```cmake +z_vcpkg_apply_patches( + SOURCE_PATH + [QUIET] + PATCHES ... +) +``` + +The `` should be set to `${SOURCE_PATH}` by convention, +and is the path to apply the patches in. + +`z_vcpkg_apply_patches` will take the list of ``es, +which are by default relative to the port directory, +and apply them in order using `git apply`. +Generally, these ``es take the form of `some.patch` +to select patches in the port directory. +One may also download patches and use `${VCPKG_DOWNLOADS}/path/to/some.patch`. + +If `QUIET` is not passed, it is a fatal error for a patch to fail to apply; +otherwise, if `QUIET` is passed, no message is printed. +This should only be used for edge cases, such as patches that are known to fail even on a clean source tree. +#]===] + +function(z_vcpkg_apply_patches) + cmake_parse_arguments(PARSE_ARGV 0 "arg" "QUIET" "SOURCE_PATH" "PATCHES") + + find_program(GIT NAMES git git.cmd REQUIRED) + if(DEFINED ENV{GIT_CONFIG_NOSYSTEM}) + set(git_config_nosystem_backuP "$ENV{GIT_CONFIG_NOSYSTEM}") + else() + unset(git_config_nosystem_backup) + endif() + + set(ENV{GIT_CONFIG_NOSYSTEM} 1) + set(patchnum 0) + foreach(patch IN LISTS arg_PATCHES) + get_filename_component(absolute_patch "${patch}" ABSOLUTE BASE_DIR "${CURRENT_PORT_DIR}") + message(STATUS "Applying patch ${patch}") + set(logname patch-${TARGET_TRIPLET}-${patchnum}) + vcpkg_execute_in_download_mode( + COMMAND "${GIT}" -c core.longpaths=true -c core.autocrlf=false --work-tree=. --git-dir=.git apply "${absolute_patch}" --ignore-whitespace --whitespace=nowarn --verbose + OUTPUT_FILE "${CURRENT_BUILDTREES_DIR}/${logname}-out.log" + ERROR_VARIABLE error + WORKING_DIRECTORY "${arg_SOURCE_PATH}" + RESULT_VARIABLE error_code + ) + file(WRITE "${CURRENT_BUILDTREES_DIR}/${logname}-err.log" "${error}") + + if(error_code AND NOT arg_QUIET) + message(FATAL_ERROR "Applying patch failed: ${error}") + endif() + + math(EXPR patchnum "${patchnum} + 1") + endforeach() + if(DEFINED git_config_nosystem_backup) + set(ENV{GIT_CONFIG_NOSYSTEM} "${git_config_nosystem_backup}") + else() + unset(ENV{GIT_CONFIG_NOSYSTEM}) + endif() +endfunction() diff --git a/scripts/ports.cmake b/scripts/ports.cmake index 68f2cbba721e82..2b1f9574a1890a 100644 --- a/scripts/ports.cmake +++ b/scripts/ports.cmake @@ -10,6 +10,11 @@ function(debug_message) message(STATUS "[DEBUG] " "${ARG_STRING}") endif() endfunction() +function(z_vcpkg_deprecation_message) + z_vcpkg_function_arguments(ARGS) + list(JOIN ARGS " " ARG_STRING) + message(DEPRECATION "${ARG_STRING}") +endfunction() option(_VCPKG_PROHIBIT_BACKCOMPAT_FEATURES "Controls whether use of a backcompat only support feature fails the build.") if (_VCPKG_PROHIBIT_BACKCOMPAT_FEATURES) @@ -128,6 +133,7 @@ if(CMD MATCHES "^BUILD$") include("${SCRIPTS}/cmake/vcpkg_replace_string.cmake") include("${SCRIPTS}/cmake/vcpkg_test_cmake.cmake") + include("${SCRIPTS}/cmake/z_vcpkg_apply_patches.cmake") include("${SCRIPTS}/cmake/z_vcpkg_prettify_command_line.cmake") include("${CURRENT_PORT_DIR}/portfile.cmake")