1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
|
/****************************************************************************
**
** Copyright (C) 2024 Ivan Komissarov (abbapoh@gmail.com)
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qbs.
**
** $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$
**
****************************************************************************/
/*!
\qmltype conan
\inqmlmodule QbsModuleProviders
\since 2.4
\brief Module provider for the Conan package manager.
This module provider allows integration with the \l{https://conan.io}{Conan} package manager.
\section1 Prerequisites
In order to use this provider, you will need \c Conan version 2.5.0 or higher. Earlier versions
do not have the \c QbsDeps generator.
\section1 Example
For details on how to setup a project to use with Conan, see the \
l{https://github.com/qbs/qbs/blob/master/examples/protobuf/addressbook_conan}{addressbook_conan}
folder in examples.
First, you will need a \l{https://docs.conan.io/2/reference/conanfile_txt.html}{conanfile} as
shown below.
\code
[requires]
protobuf/3.21.12
[tool_requires]
protobuf/3.21.12
[generators]
QbsDeps
\endcode
We use the text version for simplicity, but you can use the Python conanfile as well.
Next, set the \l{Product::qbsModuleProviders}{qbsModuleProviders} property to \c "conan":
\snippet ../examples/protobuf/addressbook_conan/addressbook_conan.qbs 0
Install Conan dependencies and run the QbsDeps generator from the \c addressbook_conan dir:
\code
$ conan install . -g=QbsDeps --output-folder=build --build missing
\endcode
This will create the \c{./build/qbs-deps} directory contaning files for provider. Now you can
pass the conan install directory to the provider:
\code
$ qbs moduleProviders.conan.installDirectory:build
\endcode
You should see the following output if everything is correct:
\code
Build graph does not yet exist for configuration 'default'. Starting from scratch.
Resolving project for configuration default
Setting up Conan module 'protobuflib'
Setting up Conan module 'zlib'
...
Build done for configuration default.
\endcode
*/
/*!
\qmlproperty string conan::installDirectory
The path to the conan install installDirectory.
\QBS searches for files created by the QbsDeps generator in that directory.
If not set, the provider will not be run.
\defaultvalue undefined
*/
|