schema_codemodel.json 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema#",
  3. "description": "Schema for the CMake codemodel object kind",
  4. "type": "object",
  5. "required": [
  6. "kind",
  7. "version",
  8. "paths",
  9. "configurations"
  10. ],
  11. "oneOf": [
  12. {
  13. "$ref": "#/definitions/codemodelV2_0"
  14. },
  15. {
  16. "$ref": "#/definitions/codemodelV2_3"
  17. }
  18. ],
  19. "definitions": {
  20. "kind": {
  21. "type": "string",
  22. "const": "codemodel",
  23. "description": "Specifies the object kind"
  24. },
  25. "versionV2_0": {
  26. "type": "object",
  27. "required": [
  28. "major",
  29. "minor"
  30. ],
  31. "properties": {
  32. "major": {
  33. "type": "integer",
  34. "const": 2
  35. },
  36. "minor": {
  37. "type": "integer",
  38. "minimum": 0,
  39. "maximum": 2
  40. }
  41. },
  42. "additionalProperties": false
  43. },
  44. "versionV2_3": {
  45. "type": "object",
  46. "required": [
  47. "major",
  48. "minor"
  49. ],
  50. "properties": {
  51. "major": {
  52. "type": "integer",
  53. "const": 2
  54. },
  55. "minor": {
  56. "type": "integer",
  57. "minimum": 3
  58. }
  59. },
  60. "additionalProperties": false
  61. },
  62. "paths": {
  63. "type": "object",
  64. "required": [
  65. "source",
  66. "build"
  67. ],
  68. "properties": {
  69. "source": {
  70. "type": "string",
  71. "description": "Absolute path to the top-level source directory"
  72. },
  73. "build": {
  74. "type": "string",
  75. "description": "Absolute path to the top-level build directory"
  76. }
  77. },
  78. "additionalProperties": false
  79. },
  80. "configurationDirectoryItemSource": {
  81. "type": "string",
  82. "description": "Path to the source directory. If it is inside the top level source directory, the path will be relative to that directory. For the top level source directory, this will simply be '.'. Paths outside the top level source directory will be absolute."
  83. },
  84. "configurationDirectoryItemBuild": {
  85. "type": "string",
  86. "description": "Path to the build directory. If it is inside the top level build directory, the path will be relative to that directory. For the top level build directory, this will simply be '.'. Paths outside the top level build directory will be absolute."
  87. },
  88. "configurationDirectoryItemParentIndex": {
  89. "type": "integer",
  90. "minimum": 0,
  91. "description": "Index of the parent directory in the directories array"
  92. },
  93. "configurationDirectoryItemChildIndexes": {
  94. "type": "array",
  95. "items": {
  96. "type": "integer",
  97. "minimum": 0
  98. },
  99. "description": "Indices of child directories"
  100. },
  101. "configurationDirectoryItemProjectIndex": {
  102. "type": "integer",
  103. "minimum": 0,
  104. "description": "Index into the projects array"
  105. },
  106. "configurationDirectoryItemTargetIndexes": {
  107. "type": "array",
  108. "items": {
  109. "type": "integer",
  110. "minimum": 0
  111. },
  112. "description": "Indices into the targets array"
  113. },
  114. "configurationDirectoryItemMinimumCMakeVersion": {
  115. "type": "object",
  116. "required": [
  117. "string"
  118. ],
  119. "properties": {
  120. "string": {
  121. "type": "string",
  122. "description": "Minimum required CMake version, if known"
  123. }
  124. },
  125. "additionalProperties": false
  126. },
  127. "configurationDirectoryItemHasInstallRule": {
  128. "type": "boolean",
  129. "description": "Whether the directory has install rules"
  130. },
  131. "configurationDirectoryItemJsonFileV2_3": {
  132. "jsonFile": {
  133. "type": "string",
  134. "description": "Path to directory-specific JSON file"
  135. }
  136. },
  137. "configurationDirectoriesV2_0": {
  138. "type": "array",
  139. "items": {
  140. "type": "object",
  141. "required": [
  142. "source",
  143. "build",
  144. "projectIndex"
  145. ],
  146. "properties": {
  147. "source": {
  148. "$ref": "#/definitions/configurationDirectoryItemSource"
  149. },
  150. "build": {
  151. "$ref": "#/definitions/configurationDirectoryItemBuild"
  152. },
  153. "parentIndex": {
  154. "$ref": "#/definitions/configurationDirectoryItemParentIndex"
  155. },
  156. "childIndexes": {
  157. "$ref": "#/definitions/configurationDirectoryItemChildIndexes"
  158. },
  159. "projectIndex": {
  160. "$ref": "#/definitions/configurationDirectoryItemProjectIndex"
  161. },
  162. "targetIndexes": {
  163. "$ref": "#/definitions/configurationDirectoryItemTargetIndexes"
  164. },
  165. "minimumCMakeVersion": {
  166. "$ref": "#/definitions/configurationDirectoryItemMinimumCMakeVersion"
  167. },
  168. "hasInstallRule": {
  169. "$ref": "#/definitions/configurationDirectoryItemHasInstallRule"
  170. }
  171. },
  172. "additionalProperties": false
  173. }
  174. },
  175. "configurationDirectoriesV2_3": {
  176. "type": "array",
  177. "items": {
  178. "type": "object",
  179. "required": [
  180. "source",
  181. "build",
  182. "projectIndex"
  183. ],
  184. "properties": {
  185. "source": {
  186. "$ref": "#/definitions/configurationDirectoryItemSource"
  187. },
  188. "build": {
  189. "$ref": "#/definitions/configurationDirectoryItemBuild"
  190. },
  191. "parentIndex": {
  192. "$ref": "#/definitions/configurationDirectoryItemParentIndex"
  193. },
  194. "childIndexes": {
  195. "$ref": "#/definitions/configurationDirectoryItemChildIndexes"
  196. },
  197. "projectIndex": {
  198. "$ref": "#/definitions/configurationDirectoryItemProjectIndex"
  199. },
  200. "targetIndexes": {
  201. "$ref": "#/definitions/configurationDirectoryItemTargetIndexes"
  202. },
  203. "minimumCMakeVersion": {
  204. "$ref": "#/definitions/configurationDirectoryItemMinimumCMakeVersion"
  205. },
  206. "hasInstallRule": {
  207. "$ref": "#/definitions/configurationDirectoryItemHasInstallRule"
  208. },
  209. "jsonFile": {
  210. "$ref": "#/definitions/configurationDirectoryItemJsonFileV2_3"
  211. }
  212. },
  213. "additionalProperties": false
  214. }
  215. },
  216. "configurationName": {
  217. "type": "string",
  218. "description": "Configuration name (e.g., 'Debug')"
  219. },
  220. "configurationProjects": {
  221. "type": "array",
  222. "items": {
  223. "type": "object",
  224. "required": [
  225. "name",
  226. "directoryIndexes"
  227. ],
  228. "properties": {
  229. "name": {
  230. "type": "string",
  231. "description": "Project name"
  232. },
  233. "parentIndex": {
  234. "type": "integer",
  235. "minimum": 0,
  236. "description": "Index of parent project"
  237. },
  238. "childIndexes": {
  239. "type": "array",
  240. "items": {
  241. "type": "integer",
  242. "minimum": 0
  243. },
  244. "description": "Indices of child projects"
  245. },
  246. "directoryIndexes": {
  247. "type": "array",
  248. "items": {
  249. "type": "integer",
  250. "minimum": 0
  251. },
  252. "description": "Indices into directories array"
  253. },
  254. "targetIndexes": {
  255. "type": "array",
  256. "items": {
  257. "type": "integer",
  258. "minimum": 0
  259. },
  260. "description": "Indices into targets array"
  261. }
  262. }
  263. }
  264. },
  265. "configurationTargets": {
  266. "type": "array",
  267. "items": {
  268. "type": "object",
  269. "required": [
  270. "name",
  271. "directoryIndex",
  272. "projectIndex",
  273. "jsonFile"
  274. ],
  275. "properties": {
  276. "name": {
  277. "type": "string",
  278. "description": "Target name"
  279. },
  280. "id": {
  281. "type": "string",
  282. "description": "Unique target identifier"
  283. },
  284. "directoryIndex": {
  285. "type": "integer",
  286. "minimum": 0,
  287. "description": "Index into directories array"
  288. },
  289. "projectIndex": {
  290. "type": "integer",
  291. "minimum": 0,
  292. "description": "Index into projects array"
  293. },
  294. "jsonFile": {
  295. "type": "string",
  296. "description": "Path to target-specific JSON file"
  297. }
  298. }
  299. }
  300. },
  301. "configurationsV2_0": {
  302. "type": "array",
  303. "items": {
  304. "type": "object",
  305. "required": [
  306. "name",
  307. "directories",
  308. "projects",
  309. "targets"
  310. ],
  311. "properties": {
  312. "name": {
  313. "$ref": "#/definitions/configurationName"
  314. },
  315. "projects": {
  316. "$ref": "#/definitions/configurationProjects"
  317. },
  318. "targets": {
  319. "$ref": "#/definitions/configurationTargets"
  320. },
  321. "directories": {
  322. "$ref": "#/definitions/configurationDirectoriesV2_0"
  323. }
  324. },
  325. "additionalProperties": false
  326. }
  327. },
  328. "configurationsV2_3": {
  329. "type": "array",
  330. "items": {
  331. "type": "object",
  332. "required": [
  333. "name",
  334. "directories",
  335. "projects",
  336. "targets"
  337. ],
  338. "properties": {
  339. "name": {
  340. "$ref": "#/definitions/configurationName"
  341. },
  342. "projects": {
  343. "$ref": "#/definitions/configurationProjects"
  344. },
  345. "targets": {
  346. "$ref": "#/definitions/configurationTargets"
  347. },
  348. "directories": {
  349. "$ref": "#/definitions/configurationDirectoriesV2_3"
  350. }
  351. },
  352. "additionalProperties": false
  353. }
  354. },
  355. "codemodelV2_0": {
  356. "properties": {
  357. "kind": {
  358. "$ref": "#/definitions/kind"
  359. },
  360. "version": {
  361. "$ref": "#/definitions/versionV2_0"
  362. },
  363. "paths": {
  364. "$ref": "#/definitions/paths"
  365. },
  366. "configurations": {
  367. "$ref": "#/definitions/configurationsV2_0"
  368. }
  369. },
  370. "additionalProperties": false
  371. },
  372. "codemodelV2_3": {
  373. "properties": {
  374. "kind": {
  375. "$ref": "#/definitions/kind"
  376. },
  377. "version": {
  378. "$ref": "#/definitions/versionV2_3"
  379. },
  380. "paths": {
  381. "$ref": "#/definitions/paths"
  382. },
  383. "configurations": {
  384. "$ref": "#/definitions/configurationsV2_3"
  385. }
  386. },
  387. "additionalProperties": false
  388. }
  389. }
  390. }