GithubHelp home page GithubHelp logo

cabinetry's Introduction

CABINETRY - A CMake-Based Buildchain Template for Embedded Systems

This repository hosts a CABINETRY project, a CMake startup project for Embedded Systems.

Development Setup

Prerequisite

Before being able to work, the developer must have installed a certain number of prerequisites.

  • Git >= 2.13
  • An IDE - preferably Visual Studio Code
  • CMake > 3.25
  • Ninja > 1.10.2
  • On Windows: LLVM's Clang > 13.0.0
  • GNU's GCC on Linux

Build

The CMake build chain takes advantage of CMake Preset to make it easier to set up workflows. All user settings are done with two files: CMakeUserPresets.json and CMakePresets.json.

If you are not aware of CMake Preset, checkout this reference.

Once the developer has cloned the repository, he should duplicate the file CMakeUserPresets.TEMPLATE.json and remove the word "TEMPLATE" from the newly created file. This file, now named CMakeUserPresets.json, is intended to be dependent on the developer's local environment. It should contain paths depending on the developer's local (specific) configuration and other volatile configuration settings.

The developer is therefore encouraged to update this file, if necessary, with his specific configuration (path to tools, etc.).

If structural changes are made to the CMakeUserPresets.json file such as adding presets (configure, build, workflow,...), the developer will need to update the CMakeUserPresets.TEMPLATE.json file accordingly and push these changes to the main branch in order to share these new buildchain configurations.

CMake Workflow presets

With the presets, you have a list of preconfigured workflows that you can access with the following command:

cmake cmake --workflow --list-presets

Choose one of them to generate the library. For example, to build the project as a static library on a Windows PC, write the command :

cmake --workflow --preset WINDOWS_AMD64_STATIC

CMake Configure/Build presets

With the preset, you have a list of preconfigurations which you can access with the following command:

cmake --list-presets

Choose one of them to generate the cache of the build chain. For example, to build on a Windows PC, write the command :

cmake --preset WINDOWS_AMD64_STATIC

Once the cache has been generated, we can proceed with the build. Normally, we would write cmake --build {presetName}, i.e. cmake --build WINDOWS_AMD64_STATIC in our example above. If there is a bug in CMake when writing this procedure (see https://gitlab.kitware.com/cmake/cmake/-/issues/22276).

In the meantime, you should prefix the {presetName} of the build folder in which the various installation folders are located:

cmake --build build/{presetName}

In our example with WINDOWS_AMD64_STATIC, we will need to enter the following command to generate the library for this configuration:

cmake --build build/WINDOWS_AMD64_STATIC

cabinetry's People

Contributors

thibfrgsgmz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.