schema_codemodel.json 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  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. "$ref": "#/definitions/codemodelV2_9"
  20. }
  21. ],
  22. "definitions": {
  23. "kind": {
  24. "type": "string",
  25. "const": "codemodel",
  26. "description": "Specifies the object kind"
  27. },
  28. "versionV2_0": {
  29. "type": "object",
  30. "required": [
  31. "major",
  32. "minor"
  33. ],
  34. "properties": {
  35. "major": {
  36. "type": "integer",
  37. "const": 2
  38. },
  39. "minor": {
  40. "type": "integer",
  41. "minimum": 0,
  42. "maximum": 2
  43. }
  44. },
  45. "additionalProperties": false
  46. },
  47. "versionV2_3": {
  48. "type": "object",
  49. "required": [
  50. "major",
  51. "minor"
  52. ],
  53. "properties": {
  54. "major": {
  55. "type": "integer",
  56. "const": 2
  57. },
  58. "minor": {
  59. "type": "integer",
  60. "minimum": 3,
  61. "maximum": 8
  62. }
  63. },
  64. "additionalProperties": false
  65. },
  66. "versionV2_9": {
  67. "type": "object",
  68. "required": [
  69. "major",
  70. "minor"
  71. ],
  72. "properties": {
  73. "major": {
  74. "type": "integer",
  75. "const": 2
  76. },
  77. "minor": {
  78. "type": "integer",
  79. "minimum": 9
  80. }
  81. },
  82. "additionalProperties": false
  83. },
  84. "paths": {
  85. "type": "object",
  86. "required": [
  87. "source",
  88. "build"
  89. ],
  90. "properties": {
  91. "source": {
  92. "type": "string",
  93. "description": "Absolute path to the top-level source directory"
  94. },
  95. "build": {
  96. "type": "string",
  97. "description": "Absolute path to the top-level build directory"
  98. }
  99. },
  100. "additionalProperties": false
  101. },
  102. "configurationDirectoryItemSource": {
  103. "type": "string",
  104. "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."
  105. },
  106. "configurationDirectoryItemBuild": {
  107. "type": "string",
  108. "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."
  109. },
  110. "configurationDirectoryItemParentIndex": {
  111. "type": "integer",
  112. "minimum": 0,
  113. "description": "Index of the parent directory in the directories array"
  114. },
  115. "configurationDirectoryItemChildIndexes": {
  116. "type": "array",
  117. "items": {
  118. "type": "integer",
  119. "minimum": 0
  120. },
  121. "description": "Indices of child directories"
  122. },
  123. "configurationDirectoryItemProjectIndex": {
  124. "type": "integer",
  125. "minimum": 0,
  126. "description": "Index into the projects array"
  127. },
  128. "configurationDirectoryItemBuildSystemTargetIndexes": {
  129. "type": "array",
  130. "items": {
  131. "type": "integer",
  132. "minimum": 0
  133. },
  134. "description": "Indices into the targets array"
  135. },
  136. "configurationDirectoryItemAbstractTargetIndexesV2_9": {
  137. "type": "array",
  138. "items": {
  139. "type": "integer",
  140. "minimum": 0
  141. },
  142. "description": "Indices into the abstractTargets array"
  143. },
  144. "configurationDirectoryItemMinimumCMakeVersion": {
  145. "type": "object",
  146. "required": [
  147. "string"
  148. ],
  149. "properties": {
  150. "string": {
  151. "type": "string",
  152. "description": "Minimum required CMake version, if known"
  153. }
  154. },
  155. "additionalProperties": false
  156. },
  157. "configurationDirectoryItemHasInstallRule": {
  158. "type": "boolean",
  159. "description": "Whether the directory has install rules"
  160. },
  161. "configurationDirectoryItemJsonFileV2_3": {
  162. "jsonFile": {
  163. "type": "string",
  164. "description": "Path to directory-specific JSON file"
  165. }
  166. },
  167. "configurationDirectoriesV2_0": {
  168. "type": "array",
  169. "items": {
  170. "type": "object",
  171. "required": [
  172. "source",
  173. "build",
  174. "projectIndex"
  175. ],
  176. "properties": {
  177. "source": {
  178. "$ref": "#/definitions/configurationDirectoryItemSource"
  179. },
  180. "build": {
  181. "$ref": "#/definitions/configurationDirectoryItemBuild"
  182. },
  183. "parentIndex": {
  184. "$ref": "#/definitions/configurationDirectoryItemParentIndex"
  185. },
  186. "childIndexes": {
  187. "$ref": "#/definitions/configurationDirectoryItemChildIndexes"
  188. },
  189. "projectIndex": {
  190. "$ref": "#/definitions/configurationDirectoryItemProjectIndex"
  191. },
  192. "targetIndexes": {
  193. "$ref": "#/definitions/configurationDirectoryItemBuildSystemTargetIndexes"
  194. },
  195. "minimumCMakeVersion": {
  196. "$ref": "#/definitions/configurationDirectoryItemMinimumCMakeVersion"
  197. },
  198. "hasInstallRule": {
  199. "$ref": "#/definitions/configurationDirectoryItemHasInstallRule"
  200. }
  201. },
  202. "additionalProperties": false
  203. }
  204. },
  205. "configurationDirectoriesV2_3": {
  206. "type": "array",
  207. "items": {
  208. "type": "object",
  209. "required": [
  210. "source",
  211. "build",
  212. "projectIndex"
  213. ],
  214. "properties": {
  215. "source": {
  216. "$ref": "#/definitions/configurationDirectoryItemSource"
  217. },
  218. "build": {
  219. "$ref": "#/definitions/configurationDirectoryItemBuild"
  220. },
  221. "parentIndex": {
  222. "$ref": "#/definitions/configurationDirectoryItemParentIndex"
  223. },
  224. "childIndexes": {
  225. "$ref": "#/definitions/configurationDirectoryItemChildIndexes"
  226. },
  227. "projectIndex": {
  228. "$ref": "#/definitions/configurationDirectoryItemProjectIndex"
  229. },
  230. "targetIndexes": {
  231. "$ref": "#/definitions/configurationDirectoryItemBuildSystemTargetIndexes"
  232. },
  233. "minimumCMakeVersion": {
  234. "$ref": "#/definitions/configurationDirectoryItemMinimumCMakeVersion"
  235. },
  236. "hasInstallRule": {
  237. "$ref": "#/definitions/configurationDirectoryItemHasInstallRule"
  238. },
  239. "jsonFile": {
  240. "$ref": "#/definitions/configurationDirectoryItemJsonFileV2_3"
  241. }
  242. },
  243. "additionalProperties": false
  244. }
  245. },
  246. "configurationDirectoriesV2_9": {
  247. "type": "array",
  248. "items": {
  249. "type": "object",
  250. "required": [
  251. "source",
  252. "build",
  253. "projectIndex"
  254. ],
  255. "properties": {
  256. "source": {
  257. "$ref": "#/definitions/configurationDirectoryItemSource"
  258. },
  259. "build": {
  260. "$ref": "#/definitions/configurationDirectoryItemBuild"
  261. },
  262. "parentIndex": {
  263. "$ref": "#/definitions/configurationDirectoryItemParentIndex"
  264. },
  265. "childIndexes": {
  266. "$ref": "#/definitions/configurationDirectoryItemChildIndexes"
  267. },
  268. "projectIndex": {
  269. "$ref": "#/definitions/configurationDirectoryItemProjectIndex"
  270. },
  271. "targetIndexes": {
  272. "$ref": "#/definitions/configurationDirectoryItemBuildSystemTargetIndexes"
  273. },
  274. "abstractTargetIndexes": {
  275. "$ref": "#/definitions/configurationDirectoryItemAbstractTargetIndexesV2_9"
  276. },
  277. "minimumCMakeVersion": {
  278. "$ref": "#/definitions/configurationDirectoryItemMinimumCMakeVersion"
  279. },
  280. "hasInstallRule": {
  281. "$ref": "#/definitions/configurationDirectoryItemHasInstallRule"
  282. },
  283. "jsonFile": {
  284. "$ref": "#/definitions/configurationDirectoryItemJsonFileV2_3"
  285. }
  286. },
  287. "additionalProperties": false
  288. }
  289. },
  290. "configurationName": {
  291. "type": "string",
  292. "description": "Configuration name (e.g., 'Debug')"
  293. },
  294. "configurationProjects": {
  295. "type": "array",
  296. "items": {
  297. "type": "object",
  298. "required": [
  299. "name",
  300. "directoryIndexes"
  301. ],
  302. "properties": {
  303. "name": {
  304. "type": "string",
  305. "description": "Project name"
  306. },
  307. "parentIndex": {
  308. "type": "integer",
  309. "minimum": 0,
  310. "description": "Index of parent project"
  311. },
  312. "childIndexes": {
  313. "type": "array",
  314. "items": {
  315. "type": "integer",
  316. "minimum": 0
  317. },
  318. "description": "Indices of child projects"
  319. },
  320. "directoryIndexes": {
  321. "type": "array",
  322. "items": {
  323. "type": "integer",
  324. "minimum": 0
  325. },
  326. "description": "Indices into directories array"
  327. },
  328. "targetIndexes": {
  329. "type": "array",
  330. "items": {
  331. "type": "integer",
  332. "minimum": 0
  333. },
  334. "description": "Indices into targets array"
  335. }
  336. }
  337. }
  338. },
  339. "configurationProjectsV2_9": {
  340. "type": "array",
  341. "items": {
  342. "type": "object",
  343. "required": [
  344. "name",
  345. "directoryIndexes"
  346. ],
  347. "properties": {
  348. "name": {
  349. "type": "string",
  350. "description": "Project name"
  351. },
  352. "parentIndex": {
  353. "type": "integer",
  354. "minimum": 0,
  355. "description": "Index of parent project"
  356. },
  357. "childIndexes": {
  358. "type": "array",
  359. "items": {
  360. "type": "integer",
  361. "minimum": 0
  362. },
  363. "description": "Indices of child projects"
  364. },
  365. "directoryIndexes": {
  366. "type": "array",
  367. "items": {
  368. "type": "integer",
  369. "minimum": 0
  370. },
  371. "description": "Indices into directories array"
  372. },
  373. "targetIndexes": {
  374. "type": "array",
  375. "items": {
  376. "type": "integer",
  377. "minimum": 0
  378. },
  379. "description": "Indices into targets array"
  380. },
  381. "abstractTargetIndexes": {
  382. "type": "array",
  383. "items": {
  384. "type": "integer",
  385. "minimum": 0
  386. },
  387. "description": "Indices into abstractTargets array"
  388. }
  389. }
  390. }
  391. },
  392. "configurationTargets": {
  393. "type": "array",
  394. "items": {
  395. "type": "object",
  396. "required": [
  397. "name",
  398. "directoryIndex",
  399. "projectIndex",
  400. "jsonFile"
  401. ],
  402. "properties": {
  403. "name": {
  404. "type": "string",
  405. "description": "Target name"
  406. },
  407. "id": {
  408. "type": "string",
  409. "description": "Unique target identifier"
  410. },
  411. "directoryIndex": {
  412. "type": "integer",
  413. "minimum": 0,
  414. "description": "Index into directories array"
  415. },
  416. "projectIndex": {
  417. "type": "integer",
  418. "minimum": 0,
  419. "description": "Index into projects array"
  420. },
  421. "jsonFile": {
  422. "type": "string",
  423. "description": "Path to target-specific JSON file"
  424. }
  425. }
  426. }
  427. },
  428. "configurationsV2_0": {
  429. "type": "array",
  430. "items": {
  431. "type": "object",
  432. "required": [
  433. "name",
  434. "directories",
  435. "projects",
  436. "targets"
  437. ],
  438. "properties": {
  439. "name": {
  440. "$ref": "#/definitions/configurationName"
  441. },
  442. "projects": {
  443. "$ref": "#/definitions/configurationProjects"
  444. },
  445. "targets": {
  446. "$ref": "#/definitions/configurationTargets"
  447. },
  448. "directories": {
  449. "$ref": "#/definitions/configurationDirectoriesV2_0"
  450. }
  451. },
  452. "additionalProperties": false
  453. }
  454. },
  455. "configurationsV2_3": {
  456. "type": "array",
  457. "items": {
  458. "type": "object",
  459. "required": [
  460. "name",
  461. "directories",
  462. "projects",
  463. "targets"
  464. ],
  465. "properties": {
  466. "name": {
  467. "$ref": "#/definitions/configurationName"
  468. },
  469. "projects": {
  470. "$ref": "#/definitions/configurationProjects"
  471. },
  472. "targets": {
  473. "$ref": "#/definitions/configurationTargets"
  474. },
  475. "directories": {
  476. "$ref": "#/definitions/configurationDirectoriesV2_3"
  477. }
  478. },
  479. "additionalProperties": false
  480. }
  481. },
  482. "configurationsV2_9": {
  483. "type": "array",
  484. "items": {
  485. "type": "object",
  486. "required": [
  487. "name",
  488. "directories",
  489. "projects",
  490. "targets",
  491. "abstractTargets"
  492. ],
  493. "properties": {
  494. "name": {
  495. "$ref": "#/definitions/configurationName"
  496. },
  497. "projects": {
  498. "$ref": "#/definitions/configurationProjectsV2_9"
  499. },
  500. "targets": {
  501. "$ref": "#/definitions/configurationTargets"
  502. },
  503. "abstractTargets": {
  504. "$ref": "#/definitions/configurationTargets"
  505. },
  506. "directories": {
  507. "$ref": "#/definitions/configurationDirectoriesV2_9"
  508. }
  509. },
  510. "additionalProperties": false
  511. }
  512. },
  513. "codemodelV2_0": {
  514. "properties": {
  515. "kind": {
  516. "$ref": "#/definitions/kind"
  517. },
  518. "version": {
  519. "$ref": "#/definitions/versionV2_0"
  520. },
  521. "paths": {
  522. "$ref": "#/definitions/paths"
  523. },
  524. "configurations": {
  525. "$ref": "#/definitions/configurationsV2_0"
  526. }
  527. },
  528. "additionalProperties": false
  529. },
  530. "codemodelV2_3": {
  531. "properties": {
  532. "kind": {
  533. "$ref": "#/definitions/kind"
  534. },
  535. "version": {
  536. "$ref": "#/definitions/versionV2_3"
  537. },
  538. "paths": {
  539. "$ref": "#/definitions/paths"
  540. },
  541. "configurations": {
  542. "$ref": "#/definitions/configurationsV2_3"
  543. }
  544. },
  545. "additionalProperties": false
  546. },
  547. "codemodelV2_9": {
  548. "properties": {
  549. "kind": {
  550. "$ref": "#/definitions/kind"
  551. },
  552. "version": {
  553. "$ref": "#/definitions/versionV2_9"
  554. },
  555. "paths": {
  556. "$ref": "#/definitions/paths"
  557. },
  558. "configurations": {
  559. "$ref": "#/definitions/configurationsV2_9"
  560. }
  561. },
  562. "additionalProperties": false
  563. }
  564. }
  565. }