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

// **********************************************************************
// NOTE: the sections are not ordered by their logical order to avoid
// reshuffling the file each time the index order changes (i.e., often).
// Run the fixnavi.pl script to adjust the links to the index order.
// **********************************************************************

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

    \ingroup creator-how-to-projects-configure
    \ingroup creator-how-to-run

    \title Configure projects for running

    To specify settings for running applications on the \l {Managing kits}{Run device} that
    you select for a kit, go to \uicontrol Projects > \uicontrol {Run Settings}.

    \image {qtcreator-settings-run-desktop.webp} {Run Settings in the Projects mode}

    The available run settings depend on the type of the project and the device:

    \list
        \li \l {Android Run Settings}{Android}
        \li \l {\B2Q Run Settings}{\B2Q}
        \li \l {Run on the desktop}{Desktop}
        \li \l {Python Run Settings}{Python}
        \li \l {QNX Run Settings}{QNX}
        \li \l {Specify remote Linux run settings}{Remote Linux}
    \endlist

    \section1 Manage run configurations

    The available run configurations are listed in the
    \uicontrol {Run configuration} field. Each run configuration belongs to a
    particular build configuration, so switching the active build configuration
    also switches the set of available run configurations. You can specify run
    settings, such as command line arguments or environments, separately for
    each build configuration, such as \e {Debug} or \e {Release}.

    To add run configurations for a build configuration, select \uicontrol Add.

    To add a run configuration that is based on the active one, select
    \uicontrol Clone.

    To copy the values from another run configuration into the active
    one, even if it belongs to another build configuration, select
    \uicontrol {Clone into This}.

    To edit the active run configuration, select \key {Ctrl+E, Ctrl+R}
    (or \key {Cmd+E, Cmd+R} on \macos).

    To rename the active run configuration, select \uicontrol Rename.

    \section2 Remove run configurations

    To remove the active run configuration, select \uicontrol Remove. To remove
    all run configurations that belong to a build configuration, select
    \uicontrol {Remove All}.

    To remove multiple run configurations:

    \list 1
        \li Select \uicontrol {Bulk Remove}.
        \li Multiselect run configurations by holding \key Ctrl and clicking
            them.
        \li Select \uicontrol {Remove selected}.
    \endlist

    \section2 qmake run configurations

    The run configurations for qmake projects derive their executable from the
    parsed \c .pro files. For more information on how the commands are constructed,
    see \l{Start external processes}.

    \section1 Select the default run target

    If a project has multiple executables, you need to tell \QC which one it
    should run.

    \section2 CMake run targets

    When using CMake, you can filter the run target list by setting
    \c qtc_runnable as the value of the \c FOLDER property
    in the \c {CMakeLists.txt} file for the project. For example:

    \badcode
    set_target_properties(main_executable PROPERTIES FOLDER "qtc_runnable")
    \endcode

    If you do not specify \c qtc_runnable for any project, \QC automatically
    adds run configurations for all targets specified in \c {CMakeLists.txt}.

    \section2 qmake run targets

    When using qmake, you can prevent \QC from automatically creating run
    configurations for subprojects by specifying the \c qtc_runnable
    variable in the \c .pro files of the application projects (\c TEMPLATE=app)
    that you want to run. For example

    \badcode
    CONFIG += qtc_runnable
    \endcode

    If none of your application projects specifies \c qtc_runnable, \QC creates
    run configurations for all application projects.

    If any of your application projects specifies \c qtc_runnable,
    \QC creates run configurations only for subprojects that also have
    \c {CONFIG += qtc_runnable} set in their \c .pro files.

    For more information about qmake project templates, see \l {TEMPLATE}.

    \section2 Meson run targets

    \QC automatically adds run configurations for all targets declared with
    \c {executable()} function in Meson build descriptions.

    \sa {Enable debugging}, {Building and running projects},
    {Set the default build and run directories},
    {Specify a custom executable to run},
    {Specify Valgrind settings for a project},
    {Run settings}
*/

/*!
    \page creator-how-to-run-custom-executables.html
    \previouspage creator-how-tos.html

    \ingroup creator-how-to-run

    \title Specify a custom executable to run

    If you use \l{Meson} or the \l{Import an existing project}
    {generic project type}, or want to run a custom desktop executable,
    create a \uicontrol {Custom Executable} run configuration for your
    project. For example, when working on a library, you can run a test
    application that links against the library.

    To specify a custom executable to run:

        \list 1
        \li Select \uicontrol Add > \uicontrol {Custom Executable}.
            \image {qtcreator-run-settings-custom-executable.webp} {Run settings for custom executables}
        \li In \uicontrol Executable, specify the path to the executable.
        \li In \uicontrol {Command line arguments}, enter the path to the
            file to run.
    \endlist

    \sa {Configure projects for running}, {Import an existing project}
*/
