/****************************************************************************
**
** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/

/*!
//! [building monolith]

This tutorial will guide you through building a monolith INTEGRITY project for a Qt example
application. You can select any Qt example application that uses the
\l {Supported Qt Modules} {Supported Qt modules}.

Before building the monolith INTEGRITY project, prepare your build environment
by running the \c setEnvironment.sh script. For more information about the script, see
\l {Creating a shell script}.

\badcode
    source ~/setEnvironment.sh
\endcode

\section1 Building the Qt application
For building a Qt6 based application using the CMake tool, run the following commands in a terminal:

\badcode
    <Qt installation path>/qtbase/bin/qt-cmake <Qt example application path>/CMakeLists.txt
    cmake --build .
\endcode

Where, \c qt-cmake is the wrapper script that calls CMake to configure your project with appropriate include paths.

\section1 Building a monolith project

The board support package (BSP) for the Qualcomm Snapdragon 8155P board provides
a build script to create a set of images for board partitions:
\badcode
    /work/ghs/sa8155/es7/es7_dev_env/hlos_dev_boot/apps/ghs_apps_proc/build_ghs.sh
\endcode

Add a Qt application to a build by adding it into the \e {monolith-service.int} file:

\list 1
    \li Start MULTI Launcher.
    \li Select \uicontrol {Components} > \uicontrol {Open Project Manager}.
    \li Select the project file \e {default.gpj}
        under the \e {/work/ghs/sa8155/es7/es7_dev_env/hlos_dev_boot/apps/ghs_apps_proc/qc_bsp} directory:
        \image open-project "Select a project"
               MULTI application shows a window with a list of project files from the chosen folder.
    \li Select \uicontrol {Open}.
\endlist

In the MULTI Project Manager view, you should see a tree structure of the opened
project.

Go through the \c default.gpj sub projects:
\list 1
    \li Select \e {target.auto} \e {vmm-adp-no-gvm-sa8155.gpj} > \e {vvm-adp-gvm-ref.gpj} > \e {monolith-service.gpj}.
        You can observe the project structure and edit a project's files.

    \li Select \e {monolith-service.int}
        \image project-structure "Project tree"
               Selected \e {monolith-service.int} file is highlited in the project tree.

    \li Right-click on the file, then select \uicontrol {Edit} from the context menu.
    \li Add the following lines at the end of the file.
        \badcode
            AddressSpace
            Name    myappname
            Filename    /path/to/your/app/executable
            MemoryPoolSize 0x2700000
            Language    C++
            HeapSize    0x90000

            Task Initial
            StackSize    0x80000
            StartIt    false
            EndTask
            Extendedmemorypoolsize 0x300000
            EndAddressSpace
        \endcode
        \note Replace </path/to/your/app/executable> with a path to your application executable.

    \li Run the build script.
        \badcode
            bash /work/ghs/sa8155/es7/es7_dev_env/hlos_dev_boot/apps/ghs_apps_proc/build_ghs.sh
        \endcode
\endlist

Your monolith project is now ready to be flashed on to the board.
//! [building monolith]
*/
