VCPKG_LOCK_FIND_PACKAGE_<Pkg> is documented as a more reliable alternative to CMake's CMAKE_REQUIRE_FIND_PACKAGE_<Pkg> and CMAKE_DISABLE_FIND_PACKAGE_<Pkg> flags, but maintainer-guide.md#when-defining-features-explicitly-control-dependencies does not demonstrate their usage. This can cause new or updated ports following the PR checklist to use outdated script.
The examples could probably be updated to use VCPKG_LOCK_FIND_PACKAGE_<Pkg> as follows:
set(VCPKG_LOCK_FIND_PACKAGE_ZLIB OFF)
if ("zlib" IN_LIST FEATURES)
set(VCPKG_LOCK_FIND_PACKAGE_ZLIB ON)
endif()
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
-DVCPKG_LOCK_FIND_PACKAGE_ZLIB=${VCPKG_LOCK_FIND_PACKAGE_ZLIB}
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
"zlib" VCPKG_LOCK_FIND_PACKAGE_ZLIB
)
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
${FEATURE_OPTIONS}
)
In addition it should probably be mentioned that VCPKG_LOCK_FIND_PACKAGE_<Pkg> is the preferred alternative to CMAKE_REQUIRE_FIND_PACKAGE_<Pkg> and CMAKE_DISABLE_FIND_PACKAGE_<Pkg>.
VCPKG_LOCK_FIND_PACKAGE_<Pkg>is documented as a more reliable alternative to CMake'sCMAKE_REQUIRE_FIND_PACKAGE_<Pkg>andCMAKE_DISABLE_FIND_PACKAGE_<Pkg>flags, but maintainer-guide.md#when-defining-features-explicitly-control-dependencies does not demonstrate their usage. This can cause new or updated ports following the PR checklist to use outdated script.The examples could probably be updated to use
VCPKG_LOCK_FIND_PACKAGE_<Pkg>as follows:In addition it should probably be mentioned that
VCPKG_LOCK_FIND_PACKAGE_<Pkg>is the preferred alternative toCMAKE_REQUIRE_FIND_PACKAGE_<Pkg>andCMAKE_DISABLE_FIND_PACKAGE_<Pkg>.