Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qbs: add QbsProfile doc #3825

Open
wants to merge 1 commit into
base: develop2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions reference/tools/qbs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ conan.tools.qbs

qbs/qbs
qbs/qbsdeps
qbs/qbsprofile
4 changes: 3 additions & 1 deletion reference/tools/qbs/qbs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ commands automatically when a package is being built directly by Conan (create,
.. code-block:: python

from conan import ConanFile
from conan.tools.qbs import Qbs, QbsDeps
from conan.tools.qbs import Qbs, QbsProfile, QbsDeps

class App(ConanFile):
settings = "os", "arch", "compiler", "build_type"
Expand All @@ -22,6 +22,8 @@ commands automatically when a package is being built directly by Conan (create,
default_options = {"shared": False, "fPIC": True}

def generate(self):
profile = QbsProfile(self)
profile.generate()
deps = QbsDeps(self)
deps.generate()

Expand Down
63 changes: 63 additions & 0 deletions reference/tools/qbs/qbsprofile.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
.. _conan_tools_qbsprofile:

QbsProfile
===========

The ``QbsProfile`` generator produces the settings file that contains toolchain information.
This file can be imported into Qbs. The ``QbsProfile`` generator can be used like:

.. code-block:: python

from conan import ConanFile

class App(ConanFile):
settings = "os", "arch", "compiler", "build_type"
requires = "hello/0.1"
generators = "QbsProfile"


It is also possible to use ``QbsProfile`` manually in the ``generate()`` method:

.. code-block:: python

from conan import ConanFile
from conan.tools.qbs import QbsProfile

class App(ConanFile):
settings = "os", "arch", "compiler", "build_type"
requires = "hello/0.1"

def generate(self):
profile = QbsProfile(self)
profile.generate()

Now we can generate the file using the ``conan install`` command.

.. code-block:: text

$ conan install . --output-folder=build --build missing

And import it into Qbs:

.. code-block:: text

$ qbs config import qbs_settings.txt --settings-dir qbs

Note that to acutually use the imported file, Qbs should be called with ``--settings-dir``:

.. code-block:: text

$ qbs resolve --settings-dir qbs

Those commands are called automatically when using the ``Qbs`` helper class.
.. seealso::

- Check the :ref:`Qbs helper <_conan_tools_qbs_helper>` for details.

Reference
---------

.. currentmodule:: conan.tools.qbs.qbsprofile

.. autoclass:: QbsProfile
:members: