Link Search Menu Expand Document

Target templates

To avoid repeating yourself in targets you can create your own target type (template). All properties of the template are inherited when used as a target type.

name = "templates"
description = "Target templates"

type = "executable"
sources = ["src/templates.cpp"]
compile-definitions = ["IS_APP"]

# Unlike interface targets you can also inherit properties

type = "app"
compile-definitions = ["APP_A"]

type = "app"
compile-definitions = ["APP_B"]

Note: In most cases you probably want to use an interface target instead.

This page was automatically generated from tests/templates/cmake.toml.