Blog

All Blog Posts  |  Next Post  |  Previous Post

Generate an SBOM for Your Delphi Application with TMS Smart Setup

Today

Generate an SBOM for a Delphi application with TMS Smart Setup

An SBOM (Software Bill of Materials) is a file that says what your software is, which license it ships under and which libraries it depends on. The EU Cyber Resilience Act requires manufacturers to draw one up, and SBOMs show up more and more in audits and security policies.

In this post we generate the SBOM of a Delphi application with TMS Smart Setup in four steps, in an environment that belongs to the project alone. This post was written by César Cardoso of Code4Delphi and is based on his article and video. The sample project is on GitHub.


The four steps

1

tms config creates tms.config.yaml.

2

tmsbuild.yaml and version.txt.

3

tms install c4d.exceptions

4

tms sbom-generate *


SETUPThe sample project

A small VCL application that uses two libraries from the Smart Setup community server, C4D-Exceptions and C4D-Msg:

uses
  C4D.Msg,
  C4D.Exceptions;

procedure TMainView.Button1Click(Sender: TObject);
begin
  ShowMsg('My message', 'More details (optional)');
end;

procedure TMainView.Button2Click(Sender: TObject);
begin
  raise ExceptionWarning.Create('My message', 'More details (optional)');
end;

At the end we want a file that says: this project, version 1.0.0, MIT license, depends on c4d.exceptions and c4d.msg.


STEP 1Make the project folder an environment

The tms command always works on the folder you are in, and it refuses to run when that folder has no tms.config.yaml. Creating this file turns the project folder into a Smart Setup environment, separate from your global installation.

In the project folder, create the default configuration:

tms config

The file opens in your editor. Change these settings:

SettingValueWhy
working folder__smartsetupDownloads, compiled libraries and logs go to this folder, apart from your sources.
servers → community → enabledtruec4d.msg and c4d.exceptions are on the community server.
skip registerfalseAdds the libraries of this environment to the Library Path, so the project compiles in the IDE.

To check, run tms list. It should run without errors and list nothing: the environment exists, but has no products yet.


STEP 2Describe the project in tmsbuild.yaml

tms.config.yaml tells Smart Setup how the environment works. tmsbuild.yaml tells it what the project is: its name and version, what to compile and what it depends on. The SBOM is built from this file.

Create tmsbuild.yaml in the project root, next to the .dproj:

minimum required tmsbuild version: 3.5

application:
  id: c4d.sbom-delphi
  name: SBOM Delphi
  description: VCL demo application used to show SBOM generation with TMS Smart Setup
  company name: Code4Delphi
  copyright: Code4Delphi
  license: MIT
  license url: https://github.com/Code4Delphi/SBOM-Delphi/blob/master/LICENSE
  url: https://github.com/Code4Delphi/SBOM-Delphi
  vcs protocol: git
  version file: version.txt

supported frameworks:
  vcl:
    ide since: delphi12
    platforms:
      - win32intel

packages:
  - SBOMDelphi: [exe, vcl]

exe options:
  compile with: latest

dependencies:
  - c4d.exceptions: C4D Exceptions
  - c4d.msg: C4D Msg

The version file setting points to version.txt. Create it in the same folder, with one line that holds the current version:

c4d.sbom-delphi: 1.0.0

What each part does:

PartWhat it does
applicationThe identity of the product. It becomes the header of the SBOM: name, version, license and supplier.
packagesWhat to compile. SBOMDelphi is the name of the .dproj, and exe says it is an executable, not a package.
dependenciesThe libraries the project uses. They set the build order and become the component list of the SBOM.
version.txtThe id at the start of the line must match the id in tmsbuild.yaml. If it doesn’t, the SBOM has no version.

You can also run tms spec, which asks you questions and writes tmsbuild.yaml for you.


STEP 3Install the dependencies in the environment

tms install downloads, compiles and registers a library. Because you run it in the project folder, everything happens in this environment and your global installation stays untouched.

tms install c4d.exceptions

You only ask for c4d.exceptions. Smart Setup installs c4d.msg as well, because the tmsbuild.yaml of C4D-Exceptions lists it as a dependency.

The Build Summary shows the products in dependency order:

- C4D Msg 1.7.0 -> OK.
- C4D Exceptions 1.6.0 -> OK.
- SBOM Delphi 1.0.0 -> OK.

The third line is your own project. Smart Setup recognized it as a product and compiled it along with the libraries.

To check the result:

  • tms list now shows c4d.exceptions, c4d.msg and c4d.sbom-delphi.
  • The libraries are in __smartsetup\Products.
  • Open the project in Delphi and run it. The IDE finds the units C4D.Msg and C4D.Exceptions in this environment.


STEP 4Generate the SBOM

tms sbom-generate *

sbom-generate doesn’t download or compile anything. It reads the tmsbuild.yaml of every product in the environment and writes a CycloneDX file next to it. For the project, that is c4d.sbom-delphi.cdx.json in the root folder:

{
  "bomFormat": "CycloneDX",
  "specVersion": "1.5",
  "version": 1,
  "serialNumber": "urn:uuid:34a3e437-e94c-4abc-ac18-4070292c8e7c",
  "metadata": {
    "timestamp": "2026-11-18T01:54:26Z",
    "tools": [
      {
        "vendor": "TMS Software",
        "name": "TMS Smart Setup"
      }
    ],
    "component": {
      "type": "library",
      "name": "c4d.sbom-delphi",
      "version": "1.0.0",
      "description": "VCL demo application used to show SBOM generation with TMS Smart Setup",
      "copyright": "Code4Delphi",
      "publisher": "Code4Delphi",
      "licenses": [
        {
          "license": {
            "name": "MIT",
            "url": "https://github.com/Code4Delphi/SBOM-Delphi/blob/master/LICENSE"
          }
        }
      ],
      "purl": "pkg:smartsetup/c4d.sbom-delphi@1.0.0",
      "externalReferences": [
        {
          "type": "website",
          "url": "https://github.com/Code4Delphi/SBOM-Delphi"
        }
      ]
    }
  },
  "components": [
    {
      "type": "library",
      "name": "c4d.exceptions",
      "purl": "pkg:smartsetup/c4d.exceptions",
      "description": "C4D Exceptions"
    },
    {
      "type": "library",
      "name": "c4d.msg",
      "purl": "pkg:smartsetup/c4d.msg",
      "description": "C4D Msg"
    }
  ],
  "dependencies": [
    {
      "ref": "pkg:smartsetup/c4d.sbom-delphi@1.0.0",
      "dependsOn": [
        "pkg:smartsetup/c4d.exceptions",
        "pkg:smartsetup/c4d.msg"
      ]
    }
  ]
}
SectionContents
metadata.componentThe project, with version, supplier, copyright and license, all taken from the application section.
componentsThe libraries the project uses.
dependenciesThe dependency graph: the project depends on both libraries.


Things to keep in mind

  • Dependencies are listed with an id and a description only. The version and license of each library are in that library’s own SBOM, which * also generates, in its product folder under __smartsetup\Products.
  • An existing SBOM file is not overwritten. After you change tmsbuild.yaml or the version, run tms sbom-generate * -force.
  • Keep __smartsetup out of version control by adding /__smartsetup to .gitignore. With tms.config.yaml and tmsbuild.yaml in the repository, anyone who clones it can rebuild the environment with tms install c4d.exceptions.
  • The SBOM lists what Smart Setup knows about, which is the dependencies declared in tmsbuild.yaml. It does not replace a tool that inspects the final executable.

Most of the work is in the application section of tmsbuild.yaml. License, copyright and version are the first things the person who receives your SBOM looks for, so check them before you share the file.



Get new posts by email
Subscribe to the weekly TMS Software newsletter to get posts like this in your inbox.


Aaron Decramer




This blog post has not received any comments yet. Add a comment.



All Blog Posts  |  Next Post  |  Previous Post