CMake support

Robin Müller robin.mueller.m at gmail.com
Thu Dec 10 21:51:36 UTC 2020


Hello,

I created a repository on github for the first version of what a CMake
support for RTEMS might look like:

https://github.com/rmspacefish/rtems-cmake

I tried to extract generic components like determining library paths into
functions  (RTEMSGeneric.cmake)
and there is a hardware specific file where flags for specific
BSPs/Architectures can be set (RTEMSHardware.cmake).

I was able to compile both the hello project and my STM32 blinky project
with really similar and short CMake files which simply call
rtems_general_config.
with a simple command like

cmake -DRTEMS_INST=$RTEMS_INST -DRTEMS_BSP=arm/stm32h7

or

cmake -DRTEMS_INST=$RTEMS_INST -DRTEMS_BSP=sparc/erc32

and then cmake --build .

I made a test repository containing everything :
https://github.com/rmspacefish/rtems-demo

Maybe this could be a part of the RTEMS repositories? In any case, I think
it can help people who would like to build their application
with CMake. The hello world example for CMake would be similar to building
the waf example for the sparc/erc32, with the difference that the
CMake support would have to be cloned and the build commands are a little
bit different.

Kind Regards
Robin


On Thu, 10 Dec 2020 at 03:26, Chris Johns <chrisj at rtems.org> wrote:

> On 10/12/20 1:18 am, Joel Sherrill wrote:
> > As I read this thread, this morning, it occurred to me that the Users
> > Manual needs a chapter on build systems for end user applications.
> > It needs to cover fetching the settings from the pkgconfig files and
> using
> > waf, old Makefile infrastructure, etc. Guidance on using cmake, scons,
> > meson, Eclipse managed builds, and Visual Studio would probably be
> > of benefit. Or at least someone may care about each build system. Likely
> > no one individual cares about more than one or two. :)
>
> +1
>
> In this section ...
>
>
> https://docs.rtems.org/branches/master/user/exe/executables.html#building-an-application
>
> Chris
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20201210/05b16cfb/attachment.html>


More information about the devel mailing list