Project Templates

TEMU can create and extend a project scaffold directly from the command line.

This is intended as a convenient starting point for new projects using project files, startup scripts, YAML components, CMake, and plugin development.

Initializing a Project

To create a new project:

temu --init-project foo

This creates a new directory foo/ with a starter layout including:

  • temu-project.yaml

  • CMakeLists.txt

  • README.adoc

  • cmake/

  • lib/

  • plugins/

  • scripts/temu/

  • scripts/python/

  • components/

  • target/

  • tests/

  • .temu/

The generated scaffold includes:

  • a project file with project metadata and default runtime settings

  • automatic session file logging

  • TEMU startup scripts

  • a starter YAML component extending at697f.yaml

  • a CMake build configured for external TEMU usage

  • a minimal CTest-enabled sample test

Using the Generated Project

The generated project can be opened in place with:

temu --project=temu-project.yaml

If the project defines named targets, a specific target can be selected with:

temu --project=temu-project.yaml --target=bare-metal

To configure and build it:

mkdir -p build
cd build
cmake -DTEMU_ROOT=/opt/temu/5.0 -G Ninja ../
ninja
ninja test

For build-tree TEMU development, TEMU_ROOT may also point at a TEMU build directory that exports TEMUConfig.cmake.

Generated Startup Files

The scaffold creates two TEMU startup scripts:

scripts/temu/imports.temu

Starts with import Component and is used to accumulate plugin imports.

scripts/temu/startup.temu

Initializes the multi-level scheduler, instantiates the default component, and adds its processor to the scheduler.

The default component is:

  • components/board.yaml

which extends at697f.yaml and overrides the default RAM and ROM sizes.

Default Runtime Layout

The generated project file uses:

runtime:
  root: .temu
  logs: logs
  snapshots: snapshots

config:
  logging:
    file:
      mode: auto

This means runtime artifacts are written below the project directory, for example:

  • .temu/logs/

  • .temu/snapshots/

Adding a Plugin

To add a new plugin scaffold to an existing project:

temu --project=temu-project.yaml --add-project-plugin=Bar

If --project is omitted, TEMU searches upwards from the current directory for temu-project.yaml.

This command:

  • creates plugins/Bar/

  • creates plugins/Bar/CMakeLists.txt

  • creates plugins/Bar/Bar.cpp

  • appends add_subdirectory(Bar) to plugins/CMakeLists.txt

  • appends import Bar to scripts/temu/imports.temu

Generated Plugin Metadata

Generated plugin source files use the current scaffolded metadata pattern:

  • vendor from project.vendor

  • copyright holder from project.copyright

  • license string from project.license

  • ABI version from the installed or referenced TEMU headers

  • local project version from the project CMake version

  • local revision from Git when available, otherwise an all-zero revision string

The plugin source uses:

  • LOCAL_MAJOR_VERSION

  • LOCAL_MINOR_VERSION

  • LOCAL_PATCH_VERSION

  • LOCAL_GIT_REVISION

  • TEMU_MAJOR_VERSION

  • TEMU_MINOR_VERSION

  • TEMU_PATCH_VERSION

These local version defines are generated through:

  • cmake/TemuProject.cmake

  • cmake/LocalVersion.h.in

Notes

The scaffold is intentionally small and is meant as a starting point. You are expected to adapt:

  • the project metadata

  • the default component

  • the startup scripts

  • the build layout

  • the generated plugin descriptions