Providing usage documentation for ports allows users to easily adopt them in their
projects. We highly encourage providing a usage file within the port's directory (ports/<port name>/usage) that describes the minimal steps necessary to integrate with a build system.
Supplying a usage file
To provide usage documentation create a text file named usage in the port's share
installation directory. The recommended method is to call the configure_file() function in
portfile.cmake.
After installing ports, vcpkg detects files installed to ${CURRENT_PACKAGES_DIR}/share/${PORT}/usage and prints their usage instructions.
Content format
Provide clear instructions on how to use the package. The content should be concise, well-structured, and emphasize the minimum build system integration required to use the library.
Be clear and concise about how to utilize the package effectively. Avoid
overwhelming users with code snippets, command-line instructions, or
configuration details. Instead, use the "documentation" property in the
port's vcpkg.json file so users can learn more
about your library.
Use the following templates as a pattern for your usage files:
Packages with CMake targets:
text
<port> provides CMake targets:
<instructions>
Header-only libraries:
text
<port> is header-only and can be used from CMake via:
<instructions>
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
vcpkg feedback
vcpkg is an open source project. Select a link to provide feedback:
V tomto modulu se seznámíte s generováním vysvětlení kódu, projektové dokumentace a dokumentace k vložené dokumentaci ke komentářům ke kódu pomocí rozšíření GitHub Copilot Chat pro Visual Studio Code.