# ximikboda/cmakemretemplate architecture

> Architecture diagram of the GitHub repository ximikboda/cmakemretemplate, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ximikboda/cmakemretemplate
- Repository: https://github.com/ximikboda/cmakemretemplate

## Overview

This repository is a CMake template for building a small MRE application, with phone and MoDis simulator packaging options. The example workflow starts at the MRE `vm_main` entry point, registers input and system-event handlers, loads a resource and draws a greeting; the template also documents executable-linking and VXP/VSM packaging functions. The graph includes documented build-template capabilities as product behavior. Source excerpts show the demo runtime, but not the subdirectory build definitions, resource target, or simulator launcher, so those connections are limited to README or root-CMake evidence.

Main entry points: [`CMakeLists.txt`](https://github.com/ximikboda/cmakemretemplate/blob/main/CMakeLists.txt) (Project configuration), [`cmake/AddMreExec.cmake`](https://github.com/ximikboda/cmakemretemplate/blob/main/cmake/AddMreExec.cmake) (MRE executable), [`main/main.cpp`](https://github.com/ximikboda/cmakemretemplate/blob/main/main/main.cpp) (Demo app), [`resources`](https://github.com/ximikboda/cmakemretemplate/tree/main/resources) (Resource pack)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Demo runtime"]
  node_demo_app["Demo app<br/>[main.cpp]"]
  node_startup["GCC startup<br/>[gccmain.c]"]
  node_mre_sdk["MRE SDK"]
end

subgraph group_build["Build and package"]
  node_root_config["Project configuration<br/>[CMakeLists.txt]"]
  node_mre_exec["MRE executable<br/>[AddMreExec.cmake]"]
  node_exec_vxp["VXP target<br/>[AddExecVxp.cmake]"]
  node_pack_vxp["VXP packer<br/>[AddPackVxp.cmake]"]
  node_exec_vsm["VSM target<br/>[AddExecVsm.cmake]"]
  node_pack_vsm["VSM packer<br/>[AddPackVsm.cmake]"]
end

subgraph group_resources["Resources and API"]
  node_resource_pack["Resource pack"]
  node_mre_api["MRE API library<br/>[null.cpp]"]
end

subgraph group_launch["Run targets"]
  node_phone(("MRE phone"))
  node_modis(("MoDis simulator"))
  node_modis_runner["MoDis runner"]
end

node_developer(("App developer"))

node_developer -->|"configures"| node_root_config
node_root_config -->|"adds subdirectory"| node_resource_pack
node_root_config -->|"adds subdirectory"| node_mre_api
node_root_config -->|"adds subdirectory"| node_modis_runner
node_root_config -->|"adds subdirectory"| node_demo_app
node_exec_vxp -->|"calls"| node_mre_exec
node_exec_vxp -->|"calls"| node_pack_vxp
node_exec_vsm -->|"calls"| node_mre_exec
node_exec_vsm -->|"calls"| node_pack_vsm
node_pack_vxp -->|"packs executable"| node_mre_exec
node_pack_vxp -->|"uses resources"| node_resource_pack
node_pack_vsm -->|"packs executable"| node_mre_exec
node_pack_vsm -->|"uses resources"| node_resource_pack
node_mre_exec -->|"links startup"| node_startup
node_startup -->|"calls vm_main"| node_demo_app
node_demo_app -->|"calls graphics APIs"| node_mre_sdk
node_demo_app -.->|"loads resource"| node_resource_pack
node_exec_vxp -->|"packages for"| node_phone
node_exec_vsm -->|"packages for"| node_modis
node_modis_runner -->|"copies and runs"| node_modis

click node_root_config "https://github.com/ximikboda/cmakemretemplate/blob/main/CMakeLists.txt"
click node_mre_exec "https://github.com/ximikboda/cmakemretemplate/blob/main/cmake/AddMreExec.cmake"
click node_exec_vxp "https://github.com/ximikboda/cmakemretemplate/blob/main/cmake/AddExecVxp.cmake"
click node_pack_vxp "https://github.com/ximikboda/cmakemretemplate/blob/main/cmake/AddPackVxp.cmake"
click node_exec_vsm "https://github.com/ximikboda/cmakemretemplate/blob/main/cmake/AddExecVsm.cmake"
click node_pack_vsm "https://github.com/ximikboda/cmakemretemplate/blob/main/cmake/AddPackVsm.cmake"
click node_demo_app "https://github.com/ximikboda/cmakemretemplate/blob/main/main/main.cpp"
click node_startup "https://github.com/ximikboda/cmakemretemplate/blob/main/common/gccmain.c"
click node_resource_pack "https://github.com/ximikboda/cmakemretemplate/tree/main/resources"
click node_mre_api "https://github.com/ximikboda/cmakemretemplate/blob/main/mreapi/null.cpp"
click node_modis_runner "https://github.com/ximikboda/cmakemretemplate/tree/main/run/run_in_MoDis"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_demo_app,node_startup,node_mre_sdk toneBlue
class node_root_config,node_mre_exec,node_exec_vxp,node_pack_vxp,node_exec_vsm,node_pack_vsm toneAmber
class node_resource_pack,node_mre_api toneMint
class node_phone,node_modis,node_modis_runner toneRose
class node_developer toneIndigo
```

## Components

### Demo runtime

- [Demo app](https://github.com/ximikboda/cmakemretemplate/blob/main/main/main.cpp): `main/main.cpp`
- [GCC startup](https://github.com/ximikboda/cmakemretemplate/blob/main/common/gccmain.c): `common/gccmain.c`
- **MRE SDK**

### Build and package

- [Project configuration](https://github.com/ximikboda/cmakemretemplate/blob/main/CMakeLists.txt): `CMakeLists.txt`
- [MRE executable](https://github.com/ximikboda/cmakemretemplate/blob/main/cmake/AddMreExec.cmake): `cmake/AddMreExec.cmake`
- [VXP target](https://github.com/ximikboda/cmakemretemplate/blob/main/cmake/AddExecVxp.cmake): `cmake/AddExecVxp.cmake`
- [VXP packer](https://github.com/ximikboda/cmakemretemplate/blob/main/cmake/AddPackVxp.cmake): `cmake/AddPackVxp.cmake`
- [VSM target](https://github.com/ximikboda/cmakemretemplate/blob/main/cmake/AddExecVsm.cmake): `cmake/AddExecVsm.cmake`
- [VSM packer](https://github.com/ximikboda/cmakemretemplate/blob/main/cmake/AddPackVsm.cmake): `cmake/AddPackVsm.cmake`

### Resources and API

- [Resource pack](https://github.com/ximikboda/cmakemretemplate/tree/main/resources): `resources`
- [MRE API library](https://github.com/ximikboda/cmakemretemplate/blob/main/mreapi/null.cpp): `mreapi/null.cpp`

### Run targets

- **MRE phone**
- **MoDis simulator**
- [MoDis runner](https://github.com/ximikboda/cmakemretemplate/tree/main/run/run_in_MoDis): `run/run_in_MoDis`

### Other components

- **App developer**

## Connections

- App developer → Project configuration: configures (evidence: `README.md`)
- Project configuration → Resource pack: adds subdirectory (evidence: `CMakeLists.txt`)
- Project configuration → MRE API library: adds subdirectory (evidence: `CMakeLists.txt`)
- Project configuration → MoDis runner: adds subdirectory (evidence: `CMakeLists.txt`)
- Project configuration → Demo app: adds subdirectory (evidence: `CMakeLists.txt`)
- VXP target → MRE executable: calls (evidence: `README.md`)
- VXP target → VXP packer: calls (evidence: `README.md`)
- VSM target → MRE executable: calls (evidence: `README.md`)
- VSM target → VSM packer: calls (evidence: `README.md`)
- VXP packer → MRE executable: packs executable (evidence: `README.md`)
- VXP packer → Resource pack: uses resources (evidence: `README.md`)
- VSM packer → MRE executable: packs executable (evidence: `README.md`)
- VSM packer → Resource pack: uses resources (evidence: `README.md`)
- MRE executable → GCC startup: links startup (evidence: `README.md`)
- GCC startup → Demo app: calls vm_main (evidence: `common/gccmain.c`)
- Demo app → MRE SDK: calls graphics APIs (evidence: `main/main.cpp`)
- Demo app → Resource pack: loads resource
- VXP target → MRE phone: packages for (evidence: `README.md`)
- VSM target → MoDis simulator: packages for (evidence: `README.md`)
- MoDis runner → MoDis simulator: copies and runs (evidence: `README.md`)
