cmake-tools
allows for various project and target specific settings to be specified.
CMakeSettings
is used for general settings.
CMakeTargetSettings
is used for settings of a specific target.
To configure these settings a lua buffer is used. Upon executing CMakeSettings
or CMakeTargetSettings
popup will open.
In this popup you are able edit the current settings.
The popup window autosaves and can be closed with q
or <esc>
Example for CMakeSettings
return {
env = {
VERBOSE = 1,
},
working_dir = "${dir.binary}"
}
Example for CMakeTargetSettings
return {
inherit_base_environment = true,
args = {}
env = {
log_level = "trace"
}
}
The popup window will show available variables and their values.
local vars = {
dir = {
binary = "",
build = ""
}
These can be used for substitution (see working_directory) or directly as lua variables.
Following settings are available:
Specify environment variables for various tasks. Strings and numbers are supported.
env = {
VERBOSE = 1,
log_level = "trace"
}
Command | Supported | Details |
---|---|---|
CMakeSettings |
✅ | environment varaibles for executing cmake commands. These are per default inherit to targets. |
CMakeTargetSettings |
✅ | environment variables for running and debugging targets. |
inherit_base_environment = true -- true|false
Command | Supported | Details |
---|---|---|
CMakeSettings |
❌ | |
CMakeTargetSettings |
✅ | Will inherit env various from base settings if set to true |
Specify additional command line arguments.
args = { "arg1", "args2=value" }
Command | Supported | Details |
---|---|---|
CMakeSettings |
❌ | |
CMakeTargetSettings |
✅ | command line arguments passed to executable when running or debugging |
Specify the working directory in which run and debug commands are executed. Supports substitution commands (${}
).
working_directory = "${dir.binary}"
Command | Supported | Details |
---|---|---|
CMakeSettings |
✅ | Defines the working directory for all targets unless overwritten. |
CMakeTargetSettings |
✅ | Sets the working directory just for this target. No default value - Has to be added manually. |