Message ID | 20230215105907.114700-1-michael.opdenacker@bootlin.com |
---|---|
State | New, archived |
Headers | show |
Series | ref-manual: classes.rst: improvements to cmake class documentation | expand |
Hi Michael, On 2/15/23 11:59, Michael Opdenacker via lists.yoctoproject.org wrote: > From: Michael Opdenacker <michael.opdenacker@bootlin.com> > > - Fix quoting for path to cmake modules > - Document OECMAKE_GENERATOR variable > - Style simplifications > > Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com> > --- > documentation/ref-manual/classes.rst | 25 ++++++++++++++----------- > documentation/ref-manual/variables.rst | 10 ++++++++++ > 2 files changed, 24 insertions(+), 11 deletions(-) > > diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst > index b5443c0d0a..3beccb4855 100644 > --- a/documentation/ref-manual/classes.rst > +++ b/documentation/ref-manual/classes.rst > @@ -346,17 +346,20 @@ in order to make them relocatable. > ``cmake`` > ========= > > -The ref:`ref-classes-cmake` class allows for recipes that need to build software using > -the `CMake <https://urldefense.com/v3/__https://cmake.org/overview/__;!!OOPJP91ZZw!iNA2vN8toaxYO2TbPOrNnBcNXS6SmFZYJDid21JEAzDilDFda1et7uKBF9xjIdOmh6u-9K0NW4WLqOXZPtlcj7xyFOiYeZ0ClIsmkLl9Ecg3LmpEaTDt$ >`__ build system. You can use > -the :term:`EXTRA_OECMAKE` variable to specify > -additional configuration options to be passed using the ``cmake`` > -command line. > - > -On the occasion that you would be installing custom CMake toolchain > -files supplied by the application being built, you should install them > -to the preferred CMake Module directory: ``${D}${datadir}/cmake/`` > -Modules during > -:ref:`ref-tasks-install`. > +The :ref:`ref-classes-cmake` class allows recipes to build software using the > +`CMake <https://urldefense.com/v3/__https://cmake.org/overview/__;!!OOPJP91ZZw!iNA2vN8toaxYO2TbPOrNnBcNXS6SmFZYJDid21JEAzDilDFda1et7uKBF9xjIdOmh6u-9K0NW4WLqOXZPtlcj7xyFOiYeZ0ClIsmkLl9Ecg3LmpEaTDt$ >`__ build system. You can use the > +:term:`EXTRA_OECMAKE` variable to specify additional configuration options to > +pass to the ``cmake`` command line. > + > +By default, the :ref:`ref-classes-cmake` class uses > +`Ninja <https://urldefense.com/v3/__https://ninja-build.org/__;!!OOPJP91ZZw!iNA2vN8toaxYO2TbPOrNnBcNXS6SmFZYJDid21JEAzDilDFda1et7uKBF9xjIdOmh6u-9K0NW4WLqOXZPtlcj7xyFOiYeZ0ClIsmkLl9Ecg3LqOSrdIo$ >`__ instead of GNU make for building, which > +offers better build performance. If a recipe is broken with Ninja, then the > +recipe can set the :term:`OECMAKE_GENERATOR` variable to ``Unix Makefiles`` to > +use GNU make instead. > + > +If you need to instal custom CMake toolchain files supplied by the application s/instal/install/ Rest is fine, so Reviewed-by: Quentin Schulz <foss+yocto@0leil.net> Thanks, Quentin
Hi Quentin, On 16.02.23 at 10:32, Quentin Schulz via lists.yoctoproject.org wrote: > Hi Michael, > > On 2/15/23 11:59, Michael Opdenacker via lists.yoctoproject.org wrote: >> From: Michael Opdenacker <michael.opdenacker@bootlin.com> >> >> - Fix quoting for path to cmake modules >> - Document OECMAKE_GENERATOR variable >> - Style simplifications >> >> Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com> >> --- >> documentation/ref-manual/classes.rst | 25 ++++++++++++++----------- >> documentation/ref-manual/variables.rst | 10 ++++++++++ >> 2 files changed, 24 insertions(+), 11 deletions(-) >> >> diff --git a/documentation/ref-manual/classes.rst >> b/documentation/ref-manual/classes.rst >> index b5443c0d0a..3beccb4855 100644 >> --- a/documentation/ref-manual/classes.rst >> +++ b/documentation/ref-manual/classes.rst >> @@ -346,17 +346,20 @@ in order to make them relocatable. >> ``cmake`` >> ========= >> -The ref:`ref-classes-cmake` class allows for recipes that need to >> build software using >> -the `CMake >> <https://urldefense.com/v3/__https://cmake.org/overview/__;!!OOPJP91ZZw!iNA2vN8toaxYO2TbPOrNnBcNXS6SmFZYJDid21JEAzDilDFda1et7uKBF9xjIdOmh6u-9K0NW4WLqOXZPtlcj7xyFOiYeZ0ClIsmkLl9Ecg3LmpEaTDt$ >> >`__ build system. You can use >> -the :term:`EXTRA_OECMAKE` variable to specify >> -additional configuration options to be passed using the ``cmake`` >> -command line. >> - >> -On the occasion that you would be installing custom CMake toolchain >> -files supplied by the application being built, you should install them >> -to the preferred CMake Module directory: ``${D}${datadir}/cmake/`` >> -Modules during >> -:ref:`ref-tasks-install`. >> +The :ref:`ref-classes-cmake` class allows recipes to build software >> using the >> +`CMake >> <https://urldefense.com/v3/__https://cmake.org/overview/__;!!OOPJP91ZZw!iNA2vN8toaxYO2TbPOrNnBcNXS6SmFZYJDid21JEAzDilDFda1et7uKBF9xjIdOmh6u-9K0NW4WLqOXZPtlcj7xyFOiYeZ0ClIsmkLl9Ecg3LmpEaTDt$ >> >`__ build system. You can use the >> +:term:`EXTRA_OECMAKE` variable to specify additional configuration >> options to >> +pass to the ``cmake`` command line. >> + >> +By default, the :ref:`ref-classes-cmake` class uses >> +`Ninja >> <https://urldefense.com/v3/__https://ninja-build.org/__;!!OOPJP91ZZw!iNA2vN8toaxYO2TbPOrNnBcNXS6SmFZYJDid21JEAzDilDFda1et7uKBF9xjIdOmh6u-9K0NW4WLqOXZPtlcj7xyFOiYeZ0ClIsmkLl9Ecg3LqOSrdIo$ >> >`__ instead of GNU make for building, which >> +offers better build performance. If a recipe is broken with Ninja, >> then the >> +recipe can set the :term:`OECMAKE_GENERATOR` variable to ``Unix >> Makefiles`` to >> +use GNU make instead. >> + >> +If you need to instal custom CMake toolchain files supplied by the >> application > > s/instal/install/ > > Rest is fine, so > Reviewed-by: Quentin Schulz <foss+yocto@0leil.net> Thanks for the review. Fixed. Cheers Michael.
diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst index b5443c0d0a..3beccb4855 100644 --- a/documentation/ref-manual/classes.rst +++ b/documentation/ref-manual/classes.rst @@ -346,17 +346,20 @@ in order to make them relocatable. ``cmake`` ========= -The ref:`ref-classes-cmake` class allows for recipes that need to build software using -the `CMake <https://cmake.org/overview/>`__ build system. You can use -the :term:`EXTRA_OECMAKE` variable to specify -additional configuration options to be passed using the ``cmake`` -command line. - -On the occasion that you would be installing custom CMake toolchain -files supplied by the application being built, you should install them -to the preferred CMake Module directory: ``${D}${datadir}/cmake/`` -Modules during -:ref:`ref-tasks-install`. +The :ref:`ref-classes-cmake` class allows recipes to build software using the +`CMake <https://cmake.org/overview/>`__ build system. You can use the +:term:`EXTRA_OECMAKE` variable to specify additional configuration options to +pass to the ``cmake`` command line. + +By default, the :ref:`ref-classes-cmake` class uses +`Ninja <https://ninja-build.org/>`__ instead of GNU make for building, which +offers better build performance. If a recipe is broken with Ninja, then the +recipe can set the :term:`OECMAKE_GENERATOR` variable to ``Unix Makefiles`` to +use GNU make instead. + +If you need to instal custom CMake toolchain files supplied by the application +being built, you should install them (during :ref:`ref-tasks-install`) to the +preferred CMake Module directory: ``${D}${datadir}/cmake/modules/``. .. _ref-classes-cml1: diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst index 62176f7ee8..c204f49aac 100644 --- a/documentation/ref-manual/variables.rst +++ b/documentation/ref-manual/variables.rst @@ -5399,6 +5399,16 @@ system and gives an overview of their function and contents. :term:`Source Directory` for details on how this class applies these additional sed command arguments. + :term:`OECMAKE_GENERATOR` + A variable for the :ref:`ref-classes-cmake` class, allowing to choose + which back-end will be generated by CMake to build an application. + + By default, this variable is set to ``Ninja``, which is faster than GNU + make, but if building is broken with Ninja, a recipe can use this + variable to use GNU make instead:: + + OECMAKE_GENERATOR = "Unix Makefiles" + :term:`OE_IMPORTS` An internal variable used to tell the OpenEmbedded build system what Python modules to import for every Python function run by the system.