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_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..8c5289c2af9800 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) @@ -60,3 +60,5 @@ - [vcpkg\_internal\_get\_cmake\_vars](internal/vcpkg_internal_get_cmake_vars.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..f73cca594bbada 100644 --- a/docs/maintainers/vcpkg_apply_patches.md +++ b/docs/maintainers/vcpkg_apply_patches.md @@ -1,6 +1,10 @@ # 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 @@ -31,4 +35,4 @@ This should only be used for edge cases, such as patches that are known to fail * [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..1fb8bb85928a59 100644 --- a/docs/maintainers/vcpkg_check_features.md +++ b/docs/maintainers/vcpkg_check_features.md @@ -1,53 +1,45 @@ # 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 ```cmake vcpkg_check_features( - OUT_FEATURE_OPTIONS - [FEATURES - - [ ] - ...] - [INVERTED_FEATURES - - [ ] - ...] + OUT_FEATURE_OPTIONS + [PREFIX ] + [FEATURES + [ ]... + ] + [INVERTED_FEATURES + [ ]... + ] ) ``` -`vcpkg_check_features()` accepts these parameters: - -* `OUT_FEATURE_OPTIONS`: - An output variable, the function will clear the variable passed to `OUT_FEATURE_OPTIONS` - and then set it to contain a list of option definitions (`-D=ON|OFF`). - - This should be set to `FEATURE_OPTIONS` by convention. - -* `FEATURES`: - A list of (`FEATURE_NAME`, `OPTION_NAME`) pairs. - For each `FEATURE_NAME` a definition is added to `OUT_FEATURE_OPTIONS` in the form of: - - * `-D=ON`, if a feature is specified for installation, - * `-D=OFF`, otherwise. - -* `INVERTED_FEATURES`: - A list of (`FEATURE_NAME`, `OPTION_NAME`) pairs, uses reversed logic from `FEATURES`. - For each `FEATURE_NAME` a definition is added to `OUT_FEATURE_OPTIONS` in the form of: - - * `-D=OFF`, if a feature is specified for installation, - * `-D=ON`, otherwise. +The `` should be set to `FEATURE_OPTIONS` by convention. -## Notes +`vcpkg_check_features()` will: -The `FEATURES` name parameter can be omitted if no `INVERTED_FEATURES` are used. +- for each `` passed in `FEATURES`: + - if the feature is set, add `-D=ON` to ``, + and set `_` to ON. + - if the feature is not set, add `-D=OFF` to ``, + and set `_` to OFF. +- for each `` passed in `INVERTED_FEATURES`: + - if the feature is set, add `-D=OFF` to ``, + and set `_` to OFF. + - if the feature is not set, add `-D=ON` to ``, + and set `_` to ON. -At least one (`FEATURE_NAME`, `OPTION_NAME`) pair must be passed to the function call. +If `` is not passed, then the feature vars set are simply ``, +not `_`. -Arguments passed to `FEATURES` and `INVERTED_FEATURES` are not validated to prevent duplication. -If the same (`FEATURE_NAME`, `OPTION_NAME`) pair is passed to both lists, -two conflicting definitions are added to `OUT_FEATURE_OPTIONS`. +If `INVERTED_FEATURES` is not passed, then the `FEATURES` keyword is optional. +This behavior is deprecated. +If the same `` is passed multiple times, +then `vcpkg_check_features` will cause a fatal error, +since that is a bug. ## Examples @@ -58,18 +50,18 @@ $ ./vcpkg install mimalloc[asm,secure] # ports/mimalloc/portfile.cmake vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - # Keyword FEATURES is optional if INVERTED_FEATURES are not used - asm MI_SEE_ASM - override MI_OVERRIDE - secure MI_SECURE + FEATURES + asm MI_SEE_ASM + override MI_OVERRIDE + secure MI_SECURE ) vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - # Expands to "-DMI_SEE_ASM=ON; -DMI_OVERRIDE=OFF; -DMI_SECURE=ON" - ${FEATURE_OPTIONS} + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + # Expands to "-DMI_SEE_ASM=ON;-DMI_OVERRIDE=OFF;-DMI_SECURE=ON" + ${FEATURE_OPTIONS} ) ``` @@ -79,18 +71,18 @@ vcpkg_configure_cmake( $ ./vcpkg install cpprestsdk[websockets] # ports/cpprestsdk/portfile.cmake -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - INVERTED_FEATURES # <- Keyword INVERTED_FEATURES required - brotli CPPREST_EXCLUDE_BROTLI - websockets CPPREST_EXCLUDE_WEBSOCKETS +vcpkg_check_features( + INVERTED_FEATURES + brotli CPPREST_EXCLUDE_BROTLI + websockets CPPREST_EXCLUDE_WEBSOCKETS ) vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - # Expands to "-DCPPREST_EXCLUDE_BROTLI=ON; -DCPPREST_EXCLUDE_WEBSOCKETS=OFF" - ${FEATURE_OPTIONS} + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + # Expands to "-DCPPREST_EXCLUDE_BROTLI=ON;-DCPPREST_EXCLUDE_WEBSOCKETS=OFF" + ${FEATURE_OPTIONS} ) ``` @@ -100,18 +92,19 @@ vcpkg_configure_cmake( $ ./vcpkg install pcl[cuda] # ports/pcl/portfile.cmake -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - cuda WITH_CUDA - cuda BUILD_CUDA - cuda BUILD_GPU +vcpkg_check_features( + FEATURES + cuda WITH_CUDA + cuda BUILD_CUDA + cuda BUILD_GPU ) vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - # Expands to "-DWITH_CUDA=ON; -DBUILD_CUDA=ON; -DBUILD_GPU=ON" - ${FEATURE_OPTIONS} + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + # Expands to "-DWITH_CUDA=ON;-DBUILD_CUDA=ON;-DBUILD_GPU=ON" + ${FEATURE_OPTIONS} ) ``` @@ -121,19 +114,19 @@ vcpkg_configure_cmake( $ ./vcpkg install rocksdb[tbb] # ports/rocksdb/portfile.cmake -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - FEATURES # <- Keyword FEATURES is required because INVERTED_FEATURES are being used - tbb WITH_TBB - INVERTED_FEATURES - tbb ROCKSDB_IGNORE_PACKAGE_TBB +vcpkg_check_features( + FEATURES + tbb WITH_TBB + INVERTED_FEATURES + tbb ROCKSDB_IGNORE_PACKAGE_TBB ) vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - # Expands to "-DWITH_TBB=ON; -DROCKSDB_IGNORE_PACKAGE_TBB=OFF" - ${FEATURE_OPTIONS} + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + # Expands to "-DWITH_TBB=ON;-DROCKSDB_IGNORE_PACKAGE_TBB=OFF" + ${FEATURE_OPTIONS} ) ``` @@ -144,4 +137,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..48ee4847040c2a 100644 --- a/scripts/cmake/vcpkg_apply_patches.cmake +++ b/scripts/cmake/vcpkg_apply_patches.cmake @@ -1,7 +1,9 @@ +# 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 diff --git a/scripts/cmake/vcpkg_check_features.cmake b/scripts/cmake/vcpkg_check_features.cmake index be4e1265c69bf8..7679b0d11aa547 100644 --- a/scripts/cmake/vcpkg_check_features.cmake +++ b/scripts/cmake/vcpkg_check_features.cmake @@ -2,53 +2,43 @@ # vcpkg_check_features Check if one or more features are a part of a package installation. -## Usage ```cmake vcpkg_check_features( - OUT_FEATURE_OPTIONS - [FEATURES - - [ ] - ...] - [INVERTED_FEATURES - - [ ] - ...] + OUT_FEATURE_OPTIONS + [PREFIX ] + [FEATURES + [ ]... + ] + [INVERTED_FEATURES + [ ]... + ] ) ``` -`vcpkg_check_features()` accepts these parameters: -* `OUT_FEATURE_OPTIONS`: - An output variable, the function will clear the variable passed to `OUT_FEATURE_OPTIONS` - and then set it to contain a list of option definitions (`-D=ON|OFF`). +The `` should be set to `FEATURE_OPTIONS` by convention. - This should be set to `FEATURE_OPTIONS` by convention. +`vcpkg_check_features()` will: -* `FEATURES`: - A list of (`FEATURE_NAME`, `OPTION_NAME`) pairs. - For each `FEATURE_NAME` a definition is added to `OUT_FEATURE_OPTIONS` in the form of: +- for each `` passed in `FEATURES`: + - if the feature is set, add `-D=ON` to ``, + and set `_` to ON. + - if the feature is not set, add `-D=OFF` to ``, + and set `_` to OFF. +- for each `` passed in `INVERTED_FEATURES`: + - if the feature is set, add `-D=OFF` to ``, + and set `_` to OFF. + - if the feature is not set, add `-D=ON` to ``, + and set `_` to ON. - * `-D=ON`, if a feature is specified for installation, - * `-D=OFF`, otherwise. +If `` is not passed, then the feature vars set are simply ``, +not `_`. -* `INVERTED_FEATURES`: - A list of (`FEATURE_NAME`, `OPTION_NAME`) pairs, uses reversed logic from `FEATURES`. - For each `FEATURE_NAME` a definition is added to `OUT_FEATURE_OPTIONS` in the form of: - - * `-D=OFF`, if a feature is specified for installation, - * `-D=ON`, otherwise. - - -## Notes - -The `FEATURES` name parameter can be omitted if no `INVERTED_FEATURES` are used. - -At least one (`FEATURE_NAME`, `OPTION_NAME`) pair must be passed to the function call. - -Arguments passed to `FEATURES` and `INVERTED_FEATURES` are not validated to prevent duplication. -If the same (`FEATURE_NAME`, `OPTION_NAME`) pair is passed to both lists, -two conflicting definitions are added to `OUT_FEATURE_OPTIONS`. +If `INVERTED_FEATURES` is not passed, then the `FEATURES` keyword is optional. +This behavior is deprecated. +If the same `` is passed multiple times, +then `vcpkg_check_features` will cause a fatal error, +since that is a bug. ## Examples @@ -59,18 +49,18 @@ $ ./vcpkg install mimalloc[asm,secure] # ports/mimalloc/portfile.cmake vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - # Keyword FEATURES is optional if INVERTED_FEATURES are not used - asm MI_SEE_ASM - override MI_OVERRIDE - secure MI_SECURE + FEATURES + asm MI_SEE_ASM + override MI_OVERRIDE + secure MI_SECURE ) vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - # Expands to "-DMI_SEE_ASM=ON; -DMI_OVERRIDE=OFF; -DMI_SECURE=ON" - ${FEATURE_OPTIONS} + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + # Expands to "-DMI_SEE_ASM=ON;-DMI_OVERRIDE=OFF;-DMI_SECURE=ON" + ${FEATURE_OPTIONS} ) ``` @@ -80,18 +70,18 @@ vcpkg_configure_cmake( $ ./vcpkg install cpprestsdk[websockets] # ports/cpprestsdk/portfile.cmake -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - INVERTED_FEATURES # <- Keyword INVERTED_FEATURES required - brotli CPPREST_EXCLUDE_BROTLI - websockets CPPREST_EXCLUDE_WEBSOCKETS +vcpkg_check_features( + INVERTED_FEATURES + brotli CPPREST_EXCLUDE_BROTLI + websockets CPPREST_EXCLUDE_WEBSOCKETS ) vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - # Expands to "-DCPPREST_EXCLUDE_BROTLI=ON; -DCPPREST_EXCLUDE_WEBSOCKETS=OFF" - ${FEATURE_OPTIONS} + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + # Expands to "-DCPPREST_EXCLUDE_BROTLI=ON;-DCPPREST_EXCLUDE_WEBSOCKETS=OFF" + ${FEATURE_OPTIONS} ) ``` @@ -101,18 +91,19 @@ vcpkg_configure_cmake( $ ./vcpkg install pcl[cuda] # ports/pcl/portfile.cmake -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - cuda WITH_CUDA - cuda BUILD_CUDA - cuda BUILD_GPU +vcpkg_check_features( + FEATURES + cuda WITH_CUDA + cuda BUILD_CUDA + cuda BUILD_GPU ) vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - # Expands to "-DWITH_CUDA=ON; -DBUILD_CUDA=ON; -DBUILD_GPU=ON" - ${FEATURE_OPTIONS} + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + # Expands to "-DWITH_CUDA=ON;-DBUILD_CUDA=ON;-DBUILD_GPU=ON" + ${FEATURE_OPTIONS} ) ``` @@ -122,19 +113,19 @@ vcpkg_configure_cmake( $ ./vcpkg install rocksdb[tbb] # ports/rocksdb/portfile.cmake -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - FEATURES # <- Keyword FEATURES is required because INVERTED_FEATURES are being used - tbb WITH_TBB - INVERTED_FEATURES - tbb ROCKSDB_IGNORE_PACKAGE_TBB +vcpkg_check_features( + FEATURES + tbb WITH_TBB + INVERTED_FEATURES + tbb ROCKSDB_IGNORE_PACKAGE_TBB ) vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - # Expands to "-DWITH_TBB=ON; -DROCKSDB_IGNORE_PACKAGE_TBB=OFF" - ${FEATURE_OPTIONS} + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + # Expands to "-DWITH_TBB=ON;-DROCKSDB_IGNORE_PACKAGE_TBB=OFF" + ${FEATURE_OPTIONS} ) ``` @@ -145,52 +136,98 @@ vcpkg_configure_cmake( * [rocksdb](https://github.com/microsoft/vcpkg/blob/master/ports/rocksdb/portfile.cmake) #]===] +function(z_vcpkg_check_features_last_feature out_var features_name features_list) + list(LENGTH features_list features_length) + math(EXPR features_length_mod_2 "${features_length} % 2") + if(NOT features_length_mod_2 EQUAL 0) + message(FATAL_ERROR "vcpkg_check_features has an incorrect number of arguments to ${features_name}") + endif() + + math(EXPR last_feature "${features_length} / 2 - 1") + set("${out_var}" "${last_feature}" PARENT_SCOPE) +endfunction() + +function(z_vcpkg_check_features_get_feature idx features_list out_feature_name out_feature_var) + math(EXPR feature_name_idx "${idx} * 2") + math(EXPR feature_var_idx "${feature_name_idx} + 1") + + list(GET features_list "${feature_name_idx}" feature_name) + list(GET features_list "${feature_var_idx}" feature_var) + + set("${out_feature_name}" "${feature_name}" PARENT_SCOPE) + set("${out_feature_var}" "${feature_var}" PARENT_SCOPE) +endfunction() + function(vcpkg_check_features) - # parse parameters such that semicolons in options arguments to COMMAND don't get erased - cmake_parse_arguments(PARSE_ARGV 0 _vcf "" "OUT_FEATURE_OPTIONS" "FEATURES;INVERTED_FEATURES") + cmake_parse_arguments( + PARSE_ARGV 0 "arg" + "" + "OUT_FEATURE_OPTIONS;PREFIX" + "FEATURES;INVERTED_FEATURES" + ) + + if(NOT DEFINED arg_OUT_FEATURE_OPTIONS) + message(FATAL_ERROR "OUT_FEATURE_OPTIONS must be defined.") + endif() + if(NOT DEFINED arg_PREFIX) + set(prefix "") + else() + set(prefix "${arg_PREFIX}_") + endif() - if (NOT DEFINED _vcf_OUT_FEATURE_OPTIONS) - message(FATAL_ERROR "OUT_FEATURE_OPTIONS must be specified.") + set(feature_options) + set(feature_variables) + + if(NOT DEFINED arg_FEATURES AND NOT DEFINED arg_INVERTED_FEATURES) + message(DEPRECATION +"calling `vcpkg_check_features` without the `FEATURES` keyword has been deprecated. + Please add the `FEATURES` keyword to the call.") + set(arg_FEATURES "${arg_UNPARSED_ARGUMENTS}") + elseif(DEFINED arg_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "vcpkg_check_features called with unknown arguments: ${arg_UNPARSED_ARGUMENTS}") endif() - macro(_check_features _vcf_ARGUMENT _set_if _set_else) - list(LENGTH ${_vcf_ARGUMENT} FEATURES_SET_LEN) - math(EXPR _vcf_INCORRECT_ARGN "${FEATURES_SET_LEN} % 2") - if(_vcf_INCORRECT_ARGN) - message(FATAL_ERROR "Called with incorrect number of arguments.") - endif() - set(_vcf_IS_FEATURE_NAME_ARG ON) - foreach(_vcf_ARG ${${_vcf_ARGUMENT}}) - if(_vcf_IS_FEATURE_NAME_ARG) - set(_vcf_FEATURE_NAME ${_vcf_ARG}) - if(NOT ${_vcf_FEATURE_NAME} IN_LIST ALL_FEATURES) - message(FATAL_ERROR "Unknown feature: ${_vcf_FEATURE_NAME}") - endif() - set(_vcf_IS_FEATURE_NAME_ARG OFF) + + z_vcpkg_check_features_last_feature(last_feature "FEATURES" "${arg_FEATURES}") + if(last_feature GREATER_EQUAL 0) + foreach(feature_pair_idx RANGE "${last_feature}") + z_vcpkg_check_features_get_feature("${feature_pair_idx}" "${arg_FEATURES}" feature_name feature_var) + + list(APPEND feature_variables "${feature_var}") + if(feature_name IN_LIST FEATURES) + list(APPEND feature_options "-D${feature_var}=ON") + set("${prefix}${feature_var}" ON PARENT_SCOPE) else() - set(_vcf_FEATURE_VARIABLE ${_vcf_ARG}) - if(${_vcf_FEATURE_NAME} IN_LIST FEATURES) - list(APPEND _vcf_FEATURE_OPTIONS "-D${_vcf_FEATURE_VARIABLE}=${_set_if}") - set(${_vcf_FEATURE_VARIABLE} "${_set_if}" PARENT_SCOPE) - else() - list(APPEND _vcf_FEATURE_OPTIONS "-D${_vcf_FEATURE_VARIABLE}=${_set_else}") - set(${_vcf_FEATURE_VARIABLE} "${_set_else}" PARENT_SCOPE) - endif() - set(_vcf_IS_FEATURE_NAME_ARG ON) + list(APPEND feature_options "-D${feature_var}=OFF") + set("${prefix}${feature_var}" OFF PARENT_SCOPE) endif() endforeach() - endmacro() + endif() - set(_vcf_FEATURE_OPTIONS) + z_vcpkg_check_features_last_feature(last_inverted_feature "INVERTED_FEATURES" "${arg_INVERTED_FEATURES}") + if(last_inverted_feature GREATER_EQUAL 0) + foreach(feature_pair_idx RANGE "${last_inverted_feature}") + z_vcpkg_check_features_get_feature("${feature_pair_idx}" "${arg_INVERTED_FEATURES}" feature_name feature_var) - if (DEFINED _vcf_FEATURES OR DEFINED _vcf_INVERTED_FEATURES) - _check_features(_vcf_FEATURES ON OFF) - _check_features(_vcf_INVERTED_FEATURES OFF ON) - else() - # Skip arguments that correspond to OUT_FEATURE_OPTIONS and its value. - list(SUBLIST ARGN 2 -1 _vcf_ARGN) - _check_features(_vcf_ARGN ON OFF) + list(APPEND feature_variables "${feature_var}") + if(feature_name IN_LIST FEATURES) + list(APPEND feature_options "-D${feature_var}=OFF") + set("${prefix}${feature_var}" OFF PARENT_SCOPE) + else() + list(APPEND feature_options "-D${feature_var}=ON") + set("${prefix}${feature_var}" ON PARENT_SCOPE) + endif() + endforeach() endif() - set(${_vcf_OUT_FEATURE_OPTIONS} "${_vcf_FEATURE_OPTIONS}" PARENT_SCOPE) + + list(SORT feature_variables) + set(last_variable) + foreach(variable IN LISTS feature_variables) + if(variable STREQUAL last_variable) + message(FATAL_ERROR "vcpkg_check_features passed the same feature variable multiple times: '${variable}'") + endif() + endforeach() + + set("${arg_OUT_FEATURE_OPTIONS}" "${feature_options}" PARENT_SCOPE) endfunction()