nuttx/Documentation/guides/cpp_cmake.rst

197 lines
5.2 KiB
ReStructuredText
Raw Normal View History

Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
.. include:: /substitutions.rst
.. _cpp_cmake:
=======================
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
C++ Example using CMake
=======================
In some situations, developers intend to implement software using the NuttX platform in
a previously set hardware and configuration where it is not possible or allowed to make
changes. In such situations, less contact with the operating source tree is better, where
it is only used for the application.
Some approaches are possible to do that today:
* https://cwiki.apache.org/confluence/display/NUTTX/Building+NuttX+with+Applications+Outside+of+the+Source+Tree
* https://www.programmersought.com/article/61604062421/
We have been seen the increase of the use of C++ language in embedded systems application. And
CMake (https://www.cmake.org) is the preferred build system used to build C++ projects. NuttX
support C++ based projects.
Using the 'build as a library' procedure of NuttX, it is possible to build NuttX
applications using C++ language and also the cmake build tool.
This document will show how to reimplement the hellocpp project using this cmake.
Preparation
===========
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
#. Base NuttX compilation changes
For this example, load the configuration 'stm32f4discovery:nsh' for building (Linux host)
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
.. code-block:: console
$ cd nuttx
$ ./tools/configure.sh -l stm32f4discovery:nsh
See :ref:`quickstart/compiling_make:Initialize Configuration` for more information about configure.sh tool.
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
In menuconfig, the main points to be changed on a typical NuttX configuration are the following:
* RTOS Features -> Tasks and Scheduling -> Application entry point to 'main'
* Library Routines -> Have C++ compiler
* Library Routines -> Have C++ initialization -> C++ Library -> Toolchain C++ support (you can also choose the basic version or the LLVM one)
* Library Routines -> Have C++ initialization -> C++ Library -> C++ low level library select -> GNU low level libsupc++
* Library Routines -> Language standard -> choose the version you want - for this example we will use "c++17"
* Library Routines -> Enable Exception Support -> to enable to support C++ exceptions - for this example we will select it
* Library Routines -> Enable RTTI Support -> to enable to support C++ RTTI features (like dynamic_cast()/typeid()) - for this example we will not enable it
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
Build NuttX and generate the export
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
.. code-block:: console
$ make export
Creating the project
====================
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
#. Create your project file structure
The project structure is organized as follow:
.. code-block:: console
hellocpp/
hellocpp/CMakeLists.txt
hellocpp/nuttx-export-12.10.0/
hellocpp/main.cpp
hellocpp/HelloWorld.h
hellocpp/HelloWorld.cpp
The directory 'nuttx-export-12.10.0' is the unzipped content from the file created during
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
make export procedure done before.
#. File contents
* hellocpp/CMakeLists.txt
.. code-block:: cmake
cmake_minimum_required(VERSION 3.12...3.31)
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
project(HelloCpp
VERSION 1.0
Fix various typos in comments and documentation Fix typos in these files: * Documentation/components/drivers/character/foc.rst * Documentation/guides/cpp_cmake.rst * Kconfig * arch/arm/src/imxrt/imxrt_lpspi.c * arch/arm/src/kinetis/kinetis_spi.c * arch/arm/src/kl/kl_spi.c * arch/arm/src/lpc31xx/lpc31_spi.c * arch/arm/src/nrf52/nrf52_radio.h * arch/arm/src/s32k1xx/s32k1xx_lpspi.c * arch/arm/src/stm32/Kconfig * arch/arm/src/stm32/stm32_adc.c * arch/arm/src/stm32/stm32_foc.c * arch/arm/src/stm32/stm32_foc.h * arch/arm/src/stm32/stm32_pwm.c * arch/arm/src/stm32/stm32_spi.c * arch/arm/src/stm32f0l0g0/stm32_spi.c * arch/arm/src/stm32f7/Kconfig * arch/arm/src/stm32f7/stm32_spi.c * arch/arm/src/stm32h7/Kconfig * arch/arm/src/stm32h7/stm32_allocateheap.c * arch/arm/src/stm32h7/stm32_fmc.c * arch/arm/src/stm32h7/stm32_fmc.h * arch/arm/src/stm32h7/stm32_pwm.c * arch/arm/src/stm32h7/stm32_qspi.c * arch/arm/src/stm32h7/stm32_spi.c * arch/arm/src/stm32l4/stm32l4_pwm.c * arch/arm/src/stm32l4/stm32l4_spi.c * arch/arm/src/stm32l5/Kconfig * arch/arm/src/stm32l5/stm32l5_spi.c * arch/renesas/src/rx65n/rx65n_dtc.c * arch/renesas/src/rx65n/rx65n_usbdev.c * arch/risc-v/src/rv32m1/rv32m1_serial.c * boards/arm/stm32/b-g431b-esc1/src/stm32_foc.c * boards/arm/stm32/nucleo-f103rb/src/stm32_foc_ihm07m1.c * boards/arm/stm32/nucleo-f302r8/src/stm32_foc_ihm07m1.c * boards/arm/stm32h7/nucleo-h743zi2/README.txt * boards/risc-v/rv32m1/rv32m1-vega/README.txt * boards/sim/sim/sim/scripts/Make.defs * drivers/1wire/1wire.c * drivers/1wire/1wire_internal.h * drivers/lcd/Kconfig * drivers/syslog/ramlog.c * fs/fat/Kconfig * libs/libc/debug/Kconfig * libs/libc/machine/Kconfig * libs/libc/stdio/lib_libvsprintf.c * libs/libc/stdlib/lib_div.c * libs/libc/stdlib/lib_ldiv.c * libs/libc/stdlib/lib_lldiv.c * libs/libdsp/lib_observer.c
2021-07-04 11:31:21 -04:00
DESCRIPTION "Hello world C++ NuttX"
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/HelloWorld.cpp
${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
)
set(EXE_NAME "hello")
add_executable(${EXE_NAME} ${SOURCE_FILES})
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
add_custom_command(
TARGET ${EXE_NAME}
POST_BUILD
COMMAND ${CMAKE_OBJCOPY} ARGS -S -O binary ${CMAKE_BINARY_DIR}/${EXE_NAME} ${CMAKE_BINARY_DIR}/${EXE_NAME}.bin
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
* hellocpp/main.cpp
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
.. code-block:: c++
#include <memory>
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
#include "HelloWorld.h"
extern "C" int main(int, char*[])
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
{
auto pHelloWorld = std::make_shared<CHelloWorld>();
pHelloWorld->HelloWorld();
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
CHelloWorld helloWorld;
helloWorld.HelloWorld();
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
return 0;
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
}
* hellocpp/HelloWorld.h
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
.. code-block:: c++
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
#ifndef HELLOWORLD_H
#define HELLOWORLD_H
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
class CHelloWorld
{
public:
CHelloWorld();
~CHelloWorld() = default;
bool HelloWorld();
private:
int mSecret;
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
};
#endif
* hellocpp/HelloWorld.cpp
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
.. code-block:: c++
#include <cstdio>
#include <string>
#include "HelloWorld.h"
CHelloWorld::CHelloWorld()
{
mSecret = 42;
std::printf("Constructor: mSecret=%d\n",mSecret);
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
}
bool CHelloWorld::HelloWorld()
{
std::printf("HelloWorld: mSecret=%d\n",mSecret);
std::string sentence = "Hello";
std::printf("TEST=%s\n",sentence.c_str());
if (mSecret == 42)
{
std::printf("CHelloWorld: HelloWorld: Hello, world!\n");
return true;
}
else
{
std::printf("CHelloWorld: HelloWorld: CONSTRUCTION FAILED!\n");
return false;
}
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
}
Building
========
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
To launch build, you use the cmake procedure:
.. code-block:: console
$ mkdir build
$ cd build
$ cmake .. -DCMAKE_TOOLCHAIN_FILE=../nuttx-export-12.10.0/scripts/toolchain.cmake
Adding example to build cmake projects in NuttX Section adjustments Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Matias N. <v01d@users.noreply.github.com> Reviewed introduction to the document Add the motivation for writing the document. Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Adding caption and name for files Correcting caption Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> test: Separating the file from the document Revert "test: Separating the file from the document" This reverts commit beec4788bdb574d9c99f1817b7ffe6e90a18fe46. Removing captions Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com> Update Documentation/guides/cpp_cmake.rst Co-authored-by: Gustavo Henrique Nihei <38959758+gustavonihei@users.noreply.github.com>
2021-03-21 15:07:09 +00:00
$ make
Two binaries are generated: an elf one - useful for debug purpose - and a binary one to be flashed on the board