You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2023/10/27 16:21:49 UTC

(nuttx) 03/10: Documentation: initialize cmake doc

This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 408441bf15c2a335bcf910686ede419d27ba37f8
Author: raiden00pl <ra...@railab.me>
AuthorDate: Fri Oct 27 11:26:25 2023 +0200

    Documentation: initialize cmake doc
---
 Documentation/components/cmake.rst                 |  6 +++
 .../{compiling.rst => compiling_cmake.rst}         | 44 +++++++---------------
 .../{compiling.rst => compiling_make.rst}          |  6 +--
 Documentation/quickstart/configuring.rst           |  2 +-
 Documentation/quickstart/index.rst                 |  3 +-
 5 files changed, 26 insertions(+), 35 deletions(-)

diff --git a/Documentation/components/cmake.rst b/Documentation/components/cmake.rst
new file mode 100644
index 0000000000..c0b133f644
--- /dev/null
+++ b/Documentation/components/cmake.rst
@@ -0,0 +1,6 @@
+=============
+CMake Support
+=============
+
+In the future this page will contain details about the CMake build system
+support in NuttX.
diff --git a/Documentation/quickstart/compiling.rst b/Documentation/quickstart/compiling_cmake.rst
similarity index 54%
copy from Documentation/quickstart/compiling.rst
copy to Documentation/quickstart/compiling_cmake.rst
index a1f4453cd1..069d38d4c2 100644
--- a/Documentation/quickstart/compiling.rst
+++ b/Documentation/quickstart/compiling_cmake.rst
@@ -1,16 +1,9 @@
-.. include:: /substitutions.rst
-.. _compiling:
+====================
+Compiling with CMake
+====================
 
-=========
-Compiling
-=========
-
-Now that we've installed Apache NuttX prerequisites and downloaded the source code,
-we are ready to compile the source code into an executable binary file that can
-be run on the embedded board.
-
-Initialize Configuration
-========================
+Initialize Configuration with CMake
+===================================
 
 The first step is to initialize NuttX configuration for a given board, based on
 a pre-existing configuration. To list all supported configurations you can do:
@@ -25,16 +18,14 @@ generally all boards support the ``nsh`` configuration which is a good starting
 since it enables booting into the interactive command line
 :doc:`/applications/nsh/index`.
 
-To choose a configuration you pass the ``<board name>:<board configuration>`` option
-to ``configure.sh`` and indicate your host platform, such as:
+To choose a configuration you pass the ``<board name>:<board configuration>`` such as:
 
     .. code-block:: console
 
        $ cd nuttx
-       $ ./tools/configure.sh -l stm32f4discovery:nsh
+       $ cmake -B build -DBOARD_CONFIG=stm32f4discovery:nsh -GNinja
 
-The ``-l`` tells use that we're on Linux (macOS and Windows builds are
-possible). Use the ``-h`` argument to see all available options.
+The ``-B build`` tells what is the build direcotry.
 
 You can then customize this configuration by using the menu based
 configuration system with:
@@ -42,22 +33,22 @@ configuration system with:
 .. code-block:: console
 
    $ cd nuttx
-   $ make menuconfig
+   $ cmake --build build -t menuconfig 
 
 Modifying the configuration is covered in :doc:`configuring`.
 
-Build NuttX
-===========
+Build NuttX with CMake
+======================
 
 We can now build NuttX. To do so, you can simply run:
 
   .. code-block:: console
 
      $ cd nuttx
-     $ make
+     $ cmake --build build -t menuconfig 
 
 The build will complete by generating the binary outputs
-inside ``nuttx`` directory. Typically this includes the ``nuttx``
+inside ``build/nuttx`` directory. Typically this includes the ``nuttx``
 ELF file (suitable for debugging using ``gdb``) and a ``nuttx.bin``
 file that can be flashed to the board.
 
@@ -65,11 +56,4 @@ To clean the build, you can do:
 
   .. code-block:: console
 
-     $ make clean
-
-.. tip::
-
-  To increase build speed (or of any other target such as ``clean``), you can
-  pass the ``-jN`` flag to ``make``, where ``N`` is the number of parallel jobs
-  to start (usually, the number of processors on your machine).
-
+     $ cmake --build build -t clean
diff --git a/Documentation/quickstart/compiling.rst b/Documentation/quickstart/compiling_make.rst
similarity index 97%
rename from Documentation/quickstart/compiling.rst
rename to Documentation/quickstart/compiling_make.rst
index a1f4453cd1..204b2bb07f 100644
--- a/Documentation/quickstart/compiling.rst
+++ b/Documentation/quickstart/compiling_make.rst
@@ -1,9 +1,9 @@
 .. include:: /substitutions.rst
 .. _compiling:
 
-=========
-Compiling
-=========
+===================
+Compiling with Make
+===================
 
 Now that we've installed Apache NuttX prerequisites and downloaded the source code,
 we are ready to compile the source code into an executable binary file that can
diff --git a/Documentation/quickstart/configuring.rst b/Documentation/quickstart/configuring.rst
index 9d197d9e48..5add3d6748 100644
--- a/Documentation/quickstart/configuring.rst
+++ b/Documentation/quickstart/configuring.rst
@@ -13,7 +13,7 @@ The Apache NuttX configuration system uses Linux's
 includes various frontends that allow you to modify configuration easily. Usually, the ``menuconfig``
 frontend is used, which is a console based menu system (more info `here <https://en.wikipedia.org/wiki/Menuconfig>`_).
 
-As previously explained in :doc:`compiling`, the first step is to load a premade configuration for
+As previously explained in :doc:`compiling_make`, the first step is to load a premade configuration for
 your board. Then, you can modify this configuration to your liking. In this example, we will show
 how you modify the default configuration of the ``sim`` build, a build of NuttX which runs on your own
 computer.
diff --git a/Documentation/quickstart/index.rst b/Documentation/quickstart/index.rst
index 24da7183e2..c77e8329e5 100644
--- a/Documentation/quickstart/index.rst
+++ b/Documentation/quickstart/index.rst
@@ -9,7 +9,8 @@ required step:
   :maxdepth: 1
 
   install.rst
-  compiling.rst
+  compiling_make.rst
+  compiling_cmake.rst
   running.rst
   configuring.rst
   debugging.rst