// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

/*!
    \page creator-vcpkg.html
    \previouspage creator-how-tos.html

    \ingroup creator-how-to-build

    \title Set up vcpkg package manager

    The experimental vcpkg plugin integrates the \l {vcpkg} C/C++ package
    manager. It is available on all the \l{Supported Platforms}
    {supported development platforms}.

    Create and edit \c vcpkg.json files to specify packages to build as part of
    your project when using CMake as the build system.

    \note Enable the Vcpkg plugin to use it.

    \section1 Set up vcpkg

    To set up vcpkg from the command line, enter:

    \badcode
    $ git clone https://github.com/microsoft/vcpkg
    $ cd vcpkg

    $ ./bootstrap-vcpkg.sh
    \endcode

    \section1 Set the path to vcpkg

    To set the \uicontrol Path to the directory where you installed vcpkg, select
    \preferences > \uicontrol CMake > \uicontrol Vcpkg.

    \image {qtcreator-preferences-cmake-vcpkg.webp} {Vcpkg tab in CMake preferences}

    Select \inlineimage {icons/online.png} {URL}
    to download vcpkg if you have not installed it yet.

    \section1 Turn off automatic setup

    By default, vcpkg is automatically set up for use with CMake. To turn off
    automatic setup, select \preferences > \uicontrol CMake > \uicontrol General
    > \uicontrol {Package manager auto setup}.

    \image {qtcreator-preferences-cmake-general.webp} {General tab in CMake preferences}

    \sa {Create vcpkg manifest files}, {Edit vcpkg manifest files},
    {Enable and disable plugins}, {Supported Platforms}, {vcpkg}
*/

/*!
    \page creator-how-to-create-vcpkg-manifest-files.html
    \previouspage creator-how-tos.html

    \ingroup creator-how-to-projects-files

    \title Create vcpkg manifest files

    To create a new \l {vcpkg} package manager manifest (\c vcpkg.json) file:

    \list 1
        \li Select \uicontrol File > \uicontrol {New File} >
            \uicontrol vcpkg > \uicontrol {vcpkg.json Manifest File} >
            \uicontrol Choose to open the \uicontrol Location dialog.
        \li In \uicontrol {File name}, enter a name for the manifest file.
        \li In \uicontrol Path, enter the path for the manifest file.
        \li Select \uicontrol Next to open the
            \uicontrol {vcpkg.json Manifest File} dialog.
            \image {qtcreator-file-new-file-vcpkg-manifest-file.webp} {vcpkg.json Manifest File dialog}
        \li In \uicontrol Name, enter a name for the manifest file.
        \li In \uicontrol {Version string}, enter a version number for the file.
        \li In \uicontrol Dependencies, enter the packages to manage.

            You can add packages later in a manifest editor.
        \li Select \uicontrol Next to open the \uicontrol {Project Management}
            page.
        \li Select \uicontrol Finish to create the file.
    \endlist

    The wizard automatically adds the \c vcpkg.json file to the \c CMakeLists.txt file
    of the project.

    \sa {Set up vcpkg package manager}, {Edit vcpkg manifest files}
*/

/*!
    \page creator-how-to-edit-vcpkg-manifest-files.html
    \previouspage creator-how-tos.html

    \ingroup creator-how-to-build

    \title Edit vcpkg manifest files

    When you open a \c vcpkg.json file, it opens in the \l {vcpkg} manifest file
    editor:

    \image {qtcreator-vcpkg-manifest-file-editor.webp} {vcpkg.json file in the manifest file editor}

    \section1 Add packages to manage

    To add a package to your project:

    \list 1
        \li Select \inlineimage {icons/vcpkg.png} {Add vcpkg Package}
            (\uicontrol {Add vcpkg Package}) on the manifest editor toolbar.
            \image {qtcreator-vcpkg-package-selector.webp} {Add vcpkg Package dialog}
        \li Select the package to add to your project.
        \li Select \uicontrol OK to return to the editor.
        \li Repeat to add more packages.
    \endlist

    \section1 Generate code for CMake configuration files

    To generate sample CMake code to copy to the \c CMakeLists.txt file:

    \list 1
        \li Select \inlineimage {icons/cmake.png} {CMake Code}
            (\uicontrol {CMake Code}) on the manifest editor toolbar.
            \image {qtcreator-vcpkg-cmake-config.webp} {CMake Code dialog}
        \li Select the example code you need and copy-paste it to the
            \c CMakeLists.txt file.
    \endlist

    \section1 Set the path to vcpkg

    To set the path to the directory where you installed vcpkg, select
    \inlineimage {icons/settings.png} {Configure} (\uicontrol Configure) on the
    editor toolbar.

    \sa {Set up vcpkg package manager}, {Create vcpkg manifest files}
*/
