parent
d905be1d13
commit
87b3c7ec6c
@ -0,0 +1,40 @@
|
|||||||
|
---
|
||||||
|
# Automatically generated from tests/templates/cmake.toml - DO NOT EDIT
|
||||||
|
layout: default
|
||||||
|
title: Target templates
|
||||||
|
permalink: /examples/templates
|
||||||
|
parent: Examples
|
||||||
|
nav_order: 7
|
||||||
|
---
|
||||||
|
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[project]
|
||||||
|
name = "templates"
|
||||||
|
description = "Target templates"
|
||||||
|
|
||||||
|
[template.app]
|
||||||
|
type = "executable"
|
||||||
|
sources = ["src/templates.cpp"]
|
||||||
|
compile-definitions = ["IS_APP"]
|
||||||
|
|
||||||
|
# Unlike interface targets you can also inherit properties
|
||||||
|
[template.app.properties]
|
||||||
|
CXX_STANDARD = "11"
|
||||||
|
CXX_STANDARD_REQUIRED = true
|
||||||
|
|
||||||
|
[target.app-a]
|
||||||
|
type = "app"
|
||||||
|
compile-definitions = ["APP_A"]
|
||||||
|
|
||||||
|
[target.app-b]
|
||||||
|
type = "app"
|
||||||
|
compile-definitions = ["APP_B"]
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note**: In most cases you probably want to use an [interface](/examples/interface) target instead.
|
||||||
|
|
||||||
|
<sup><sub>This page was automatically generated from [tests/templates/cmake.toml](https://github.com/build-cpp/cmkr/tree/main/tests/templates/cmake.toml).</sub></sup>
|
@ -1,41 +1,47 @@
|
|||||||
[[test]]
|
[[test]]
|
||||||
name = "basic"
|
name = "basic"
|
||||||
command = "$<TARGET_FILE:cmkr>"
|
|
||||||
working-directory = "basic"
|
working-directory = "basic"
|
||||||
|
command = "$<TARGET_FILE:cmkr>"
|
||||||
arguments = ["build"]
|
arguments = ["build"]
|
||||||
|
|
||||||
[[test]]
|
[[test]]
|
||||||
name = "interface"
|
name = "interface"
|
||||||
command = "$<TARGET_FILE:cmkr>"
|
|
||||||
working-directory = "interface"
|
working-directory = "interface"
|
||||||
|
command = "$<TARGET_FILE:cmkr>"
|
||||||
arguments = ["build"]
|
arguments = ["build"]
|
||||||
|
|
||||||
[[test]]
|
[[test]]
|
||||||
name = "fetch-content"
|
name = "fetch-content"
|
||||||
command = "$<TARGET_FILE:cmkr>"
|
|
||||||
working-directory = "fetch-content"
|
working-directory = "fetch-content"
|
||||||
|
command = "$<TARGET_FILE:cmkr>"
|
||||||
arguments = ["build"]
|
arguments = ["build"]
|
||||||
|
|
||||||
[[test]]
|
[[test]]
|
||||||
name = "conditions"
|
name = "conditions"
|
||||||
command = "$<TARGET_FILE:cmkr>"
|
|
||||||
working-directory = "conditions"
|
working-directory = "conditions"
|
||||||
|
command = "$<TARGET_FILE:cmkr>"
|
||||||
arguments = ["build"]
|
arguments = ["build"]
|
||||||
|
|
||||||
[[test]]
|
[[test]]
|
||||||
name = "vcpkg"
|
name = "vcpkg"
|
||||||
command = "$<TARGET_FILE:cmkr>"
|
|
||||||
working-directory = "vcpkg"
|
working-directory = "vcpkg"
|
||||||
|
command = "$<TARGET_FILE:cmkr>"
|
||||||
arguments = ["build"]
|
arguments = ["build"]
|
||||||
|
|
||||||
[[test]]
|
[[test]]
|
||||||
name = "cxx-standard"
|
name = "cxx-standard"
|
||||||
command = "$<TARGET_FILE:cmkr>"
|
|
||||||
working-directory = "cxx-standard"
|
working-directory = "cxx-standard"
|
||||||
|
command = "$<TARGET_FILE:cmkr>"
|
||||||
arguments = ["build"]
|
arguments = ["build"]
|
||||||
|
|
||||||
[[test]]
|
[[test]]
|
||||||
name = "globbing"
|
name = "globbing"
|
||||||
command = "$<TARGET_FILE:cmkr>"
|
|
||||||
working-directory = "globbing"
|
working-directory = "globbing"
|
||||||
|
command = "$<TARGET_FILE:cmkr>"
|
||||||
|
arguments = ["build"]
|
||||||
|
|
||||||
|
[[test]]
|
||||||
|
name = "templates"
|
||||||
|
working-directory = "templates"
|
||||||
|
command = "$<TARGET_FILE:cmkr>"
|
||||||
arguments = ["build"]
|
arguments = ["build"]
|
||||||
|
Loading…
Reference in new issue