Update toml reference

main
Duncan Ogilvie 3 years ago
parent 459ebb14b5
commit 9db82dfd05

@ -47,6 +47,8 @@ arch64 = "CMAKE_SIZEOF_VOID_P EQUALS 8"
arch32 = "CMAKE_SIZEOF_VOID_P EQUALS 4" arch32 = "CMAKE_SIZEOF_VOID_P EQUALS 4"
``` ```
This will make the `arch64` and `arch32` conditions available with their respective CMake expressions.
You can also prefix most keys with `condition.` to represent a conditional: You can also prefix most keys with `condition.` to represent a conditional:
```toml ```toml
@ -56,7 +58,7 @@ sources = ["src/main.cpp"]
windows.sources = ["src/windows_specific.cpp"] windows.sources = ["src/windows_specific.cpp"]
``` ```
This will make the `arch64` and `arch32` conditions available with their respective CMake expressions. The following conditions are predefined (you can override them if you desire): The following conditions are predefined (you can override them if you desire):
```toml ```toml
[conditions] [conditions]
@ -74,7 +76,7 @@ msvc = "MSVC"
```toml ```toml
[subdir.mysubdir] [subdir.mysubdir]
condition = "linux" condition = "mycondition"
cmake-before = """ cmake-before = """
message(STATUS "CMake injected before the add_subdirectory() call" message(STATUS "CMake injected before the add_subdirectory() call"
""" """
@ -101,11 +103,8 @@ To specify package features you can use the following syntax: `imgui[docking-exp
## Packages ## Packages
```toml ```toml
[find-package]
mypackage = { version = "1.0", required = true, config = true, components = ["mycomponent"] }
# Alternative syntax
[find-package.mypackage] [find-package.mypackage]
condition = "mycondition"
version = "1.0" version = "1.0"
required = true required = true
config = true config = true
@ -117,22 +116,27 @@ components = ["mycomponent"]
**Note**: The `[fetch-content]` feature is unpolished and will likely change in a future release. **Note**: The `[fetch-content]` feature is unpolished and will likely change in a future release.
```toml ```toml
[fetch-content]
gitcontent = { git = "https://github.com/myuser/gitcontent", tag = "v0.1" }
svncontent = { svn = "https://svn-host.com/url", rev = "svn_rev" }
urlcontent = { url = "https://content-host.com/urlcontent.zip", hash = "123123123123" }
# Alternative syntax
[fetch-content.gitcontent] [fetch-content.gitcontent]
condition = "mycondition"
git = "https://github.com/myuser/gitcontent" git = "https://github.com/myuser/gitcontent"
tag = "v0.1" tag = "v0.1"
[fetch-content.svncontent]
condition = "mycondition"
svn = "https://svn-host.com/url"
rev = "svn_rev"
[fetch-content.urlcontent]
condition = "mycondition"
url = "https://content-host.com/urlcontent.zip"
hash = "123123123123"
``` ```
## Targets ## Targets
```toml ```toml
[target.mytarget] [target.mytarget]
condition = "linux" condition = "mycondition"
alias = "mytarget::mytarget" alias = "mytarget::mytarget"
type = "static" # executable, shared (DLL), static, interface, object, library, custom type = "static" # executable, shared (DLL), static, interface, object, library, custom
headers = ["src/mytarget.h"] headers = ["src/mytarget.h"]
@ -180,6 +184,7 @@ FOLDER = "MyFolder"
```toml ```toml
# You can declare as many as you want like this, but the name has to be unique # You can declare as many as you want like this, but the name has to be unique
[[test]] [[test]]
condition = "mycondition"
name = "mytest" name = "mytest"
command = "$<TARGET_FILE:mytest>" command = "$<TARGET_FILE:mytest>"
arguments = ["arg1", "arg2"] arguments = ["arg1", "arg2"]
@ -189,6 +194,7 @@ working-directory = "mytest-dir"
```toml ```toml
[[install]] [[install]]
condition = "mycondition"
targets = ["mytarget", "mytest"] targets = ["mytarget", "mytest"]
destination = ["bin"] destination = ["bin"]
files = ["content/my.png"] files = ["content/my.png"]

Loading…
Cancel
Save