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 launch 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,
},
build_dir = nil,
working_dir = "${dir.binary}"
use_preset = true,
generate_options = {},
build_options = {},
}
Example for CMakeTargetSettings
return {
inherit_base_environment = true,
args = {}
env = {
log_level = "trace"
},
working_dir = "${dir.binary}"
}
The popup window will show available variables and their values. And please attention that the value of vars is auto computed, and cannot be changed.
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. |
Specify if the --presets
argument should be used on cmake
commands. This is useful when you want to control all of the cmake
options with the generate_options
and the build_options
.
use_preset = true
Command | Supported | Details |
---|---|---|
CMakeSettings |
✅ | Flag controlling if the --presets argument should be passed to the cmake commands |
CMakeTargetSettings |
❌ |
Specify the build directory in which generate files should locate.
build_directory = ""
Command | Supported | Details |
---|---|---|
CMakeSettings |
✅ | Defines the build directory. |
CMakeTargetSettings |
❌ |
Specify the generate options for cmake project.
generate_options = {}
Command | Supported | Details |
---|---|---|
CMakeSettings |
✅ | Defines the generate options. |
CMakeTargetSettings |
❌ |
Specify the build options for cmake project.
build_options = {}
Command | Supported | Details |
---|---|---|
CMakeSettings |
✅ | Defines the build options for all targets. |
CMakeTargetSettings |
❌ |