-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathcmake-integration-variables.el
157 lines (96 loc) · 5.71 KB
/
cmake-integration-variables.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
;;; cmake-integration-variables.el --- Custom variables and constants -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:
(defgroup cmake-integration nil "Easily call cmake configure and run compiled targets." :group 'tools :prefix "cmake-integration-")
(defcustom cmake-integration-build-dir "build"
"The build folder to use when no presets are used.
If this is nil, then using presets is required." :type '(string) :group 'cmake-integration)
(defcustom cmake-integration-install-prefix nil
"The install preffix to use when running cmake install.
If this is nil, then no install preffix is used." :type '(string) :group 'cmake-integration)
;; TODO: Set all possible choices of generators for a better
;; customization interface (but still allow a free string as a
;; generator)
(defcustom cmake-integration-generator nil
"The generator to pass to cmake when no presets are used.
If this is nil, then the generator is not explicitly set." :type '(string) :group 'cmake-integration)
(defcustom cmake-integration-annotation-column 30
"Column where annotations should start during completion." :type '(integer) :group 'cmake-integration)
(defcustom cmake-integration-include-subproject-targets-during-completion t
"If t, include subproject targets when presenting target names for completion.
When t (default) all targets are included during completion of
target names. If nil, then only targets from the main cmake
project are included (targets with projectIndex equal to zero)."
:type 'boolean :safe #'booleanp :group 'cmake-integration)
(defcustom cmake-integration-hide-utility-targets-during-completion nil
"If t, then utility targets are not included during completion."
:type 'boolean :safe #'booleanp :group 'cmake-integration)
(defcustom cmake-integration-hide-library-targets-during-completion nil
"If t, then library targets are not included during completion."
:type 'boolean :safe #'booleanp :group 'cmake-integration)
;; Tell the byte compile that
;; cmake-integration--run-working-directory-p is defined in the
;; "-core" file
(declare-function cmake-integration--run-working-directory-p "cmake-integration-core.el")
(defcustom cmake-integration-run-working-directory 'bin
"Working directory when running a target executable.
Possible values are the symbols `bin' (to run from the folder
containing the executable), `build' (to run from the build folder)
and `root' (to run from the project root), as well as any string.
In the case of a string, it should match an existing subfolder of
the project root." :type '(choice symbol string)
:group 'cmake-integration
:safe #'cmake-integration--run-working-directory-p
:local t)
(defcustom cmake-integration-create-compile-commands-link t
"If t, make a link of `compile_commands.json' to the project root.
This helps lsp and clangd correctly parsing the project files."
:type 'boolean :safe #'booleanp :group 'cmake-integration)
(defcustom cmake-integration-use-dap-for-debug nil
"If t, use `dap-mode' with cpptools for debug.
If nil, use standard gdb graphical interface (see Emacs manual)."
:type 'boolean :safe #'booleanp :group 'cmake-integration)
(defcustom cmake-integration-conan-arguments "--build missing" "Extra arguments to pass to conan." :type '(string) :group 'cmake-integration)
;; TODO: Investigate if it is possible to get completions for the conan and cmake profiles in the custom interface
(defcustom cmake-integration-conan-profile nil
"Conan profile to use, or an alist mapping cmake profiles to conan profiles."
:type '(choice
(const :tag "Don't use any Conan profile" nil)
(string :tag "Use a single Conan profile")
(alist :tag "Map a CMake profile into a Conan profile"
:key-type (string :tag "Cmake profile")
:value-type (string :tag "Conan profile")))
:safe #'listp
:group 'cmake-integration)
(defcustom cmake-integration-include-conan-toolchain-file nil
"If t, pass '--toolchain conan_toolchain.cmake' to cmake.
If you are using the `CMakeToolchain' generator, set this to true
in a directory local variable in your project."
:type 'boolean :safe #'booleanp :group 'cmake-integration)
(defcustom cmake-integration-docs-folder "${sourceDir}/docs"
"Folder containing the Doxyfile.
If \"${sourceDir}/\" is in `cmake-integration-docs-folder' it
will be replaced by the project root." :type 'string :group 'cmake-integration)
(defvar cmake-integration-current-target nil "Name of the target that will be compiled and run.")
(defvar cmake-integration-run-arguments "" "Command line arguments when running a target.")
;; This an alist like
;; ((name . "preset-name") (displayName . "Preset name shown in annotation")
;; (description . "...")
;; (generator . "Ninja")
;; (cacheVariables (CMAKE_POLICY_DEFAULT_CMP0091 . "NEW"))
;; (toolchainFile . "generators/conan_toolchain.cmake")
;; (binaryDir . "/some/path/to/build/folder"))
(defvar cmake-integration-configure-preset nil "Preset used for the configure step.")
(defvar cmake-integration-build-preset nil "Preset used for the build step.")
(defvar cmake-integration-test-preset nil "Preset used for the test step.")
(defvar cmake-integration-package-preset nil "Preset used for the package step.")
(defconst cmake-integration--multi-config-separator "/"
"Character used to separate target name from config name.
In case of of multi-config generators, target names have the
special form <target-name><sep><config-name> (e.g. `all/Debug'
with `/' as configured separator).
Note: The selected separator shall be a character that it is not
a valid component of a CMake target name (see
https://cmake.org/cmake/help/latest/policy/CMP0037.html ).")
(provide 'cmake-integration-variables)
;;; cmake-integration-variables.el ends here