Skip to content

maintainer-guide.md not updated to use VCPKG_LOCK_FIND_PACKAGE_<Pkg> #562

@HexDecimal

Description

@HexDecimal

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>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions