ref-manual, dev-manual: Added CMake toolchain files.

Fixes [YOCTO #12760]

Updated the cmake.bbclass description to tell what directory
to insall custom CMake toolchain files into.  Also, updated
the two areas in the "Writing a New Recipe" section that
mention CMake.  Placed a couple notes there concerning the
same directory stuff.

(From yocto-docs rev: a65cd2c4c062d4ae388191b9d6708b4fadffaa3f)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Scott Rifenbark
2019-10-17 12:09:17 -07:00
committed by Richard Purdie
parent 20d648416b
commit ff0db7b88e
2 changed files with 31 additions and 3 deletions

View File

@@ -2349,7 +2349,7 @@
Most software provides some means of setting build-time Most software provides some means of setting build-time
configuration options before compilation. configuration options before compilation.
Typically, setting these options is accomplished by running a Typically, setting these options is accomplished by running a
configure script with some options, or by modifying a build configure script with options, or by modifying a build
configuration file. configuration file.
<note> <note>
As of Yocto Project Release 1.7, some of the core recipes As of Yocto Project Release 1.7, some of the core recipes
@@ -2389,6 +2389,7 @@
software is built using Autotools. software is built using Autotools.
If this is the case, you just need to worry about If this is the case, you just need to worry about
modifying the configuration.</para> modifying the configuration.</para>
<para>When using Autotools, your recipe needs to inherit <para>When using Autotools, your recipe needs to inherit
the the
<ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-autotools'><filename>autotools</filename></ulink> <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-autotools'><filename>autotools</filename></ulink>
@@ -2401,13 +2402,15 @@
or or
<ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGECONFIG_CONFARGS'><filename>PACKAGECONFIG_CONFARGS</filename></ulink> <ulink url='&YOCTO_DOCS_REF_URL;#var-PACKAGECONFIG_CONFARGS'><filename>PACKAGECONFIG_CONFARGS</filename></ulink>
to pass any needed configure options that are specific to pass any needed configure options that are specific
to the recipe.</para></listitem> to the recipe.
</para></listitem>
<listitem><para><emphasis>CMake:</emphasis> <listitem><para><emphasis>CMake:</emphasis>
If your source files have a If your source files have a
<filename>CMakeLists.txt</filename> file, then your <filename>CMakeLists.txt</filename> file, then your
software is built using CMake. software is built using CMake.
If this is the case, you just need to worry about If this is the case, you just need to worry about
modifying the configuration.</para> modifying the configuration.</para>
<para>When you use CMake, your recipe needs to inherit <para>When you use CMake, your recipe needs to inherit
the the
<ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-cmake'><filename>cmake</filename></ulink> <ulink url='&YOCTO_DOCS_REF_URL;#ref-classes-cmake'><filename>cmake</filename></ulink>
@@ -2417,7 +2420,16 @@
You can make some adjustments by setting You can make some adjustments by setting
<ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_OECMAKE'><filename>EXTRA_OECMAKE</filename></ulink> <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_OECMAKE'><filename>EXTRA_OECMAKE</filename></ulink>
to pass any needed configure options that are specific to pass any needed configure options that are specific
to the recipe.</para></listitem> to the recipe.
<note>
If you need to install one or more custom CMake
toolchain files that are supplied by the
application you are building, install the files to
<filename>${D}${datadir}/cmake/</filename> Modules
during
<ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-install'><filename>do_install</filename></ulink>.
</note>
</para></listitem>
<listitem><para><emphasis>Other:</emphasis> <listitem><para><emphasis>Other:</emphasis>
If your source files do not have a If your source files do not have a
<filename>configure.ac</filename> or <filename>configure.ac</filename> or
@@ -2780,6 +2792,14 @@
<ulink url='&YOCTO_DOCS_REF_URL;#var-PARALLEL_MAKEINST'><filename>PARALLEL_MAKEINST</filename></ulink> <ulink url='&YOCTO_DOCS_REF_URL;#var-PARALLEL_MAKEINST'><filename>PARALLEL_MAKEINST</filename></ulink>
for additional information. for additional information.
</para></listitem> </para></listitem>
<listitem><para>
If you need to install one or more custom CMake
toolchain files that are supplied by the
application you are building, install the files to
<filename>${D}${datadir}/cmake/</filename> Modules
during
<ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-install'><filename>do_install</filename></ulink>.
</para></listitem>
</itemizedlist> </itemizedlist>
</note> </note>
</section> </section>

View File

@@ -428,6 +428,14 @@
variable to specify additional configuration options to be passed variable to specify additional configuration options to be passed
using the <filename>cmake</filename> command line. using the <filename>cmake</filename> command line.
</para> </para>
<para>
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:
<filename>${D}${datadir}/cmake/</filename> Modules during
<ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-install'><filename>do_install</filename></ulink>.
</para>
</section> </section>
<section id='ref-classes-cml1'> <section id='ref-classes-cml1'>