File: cmake-file-api.7.rst

package info (click to toggle)
cmake 4.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 152,348 kB
  • sloc: ansic: 403,894; cpp: 303,807; sh: 4,097; python: 3,582; yacc: 3,106; lex: 1,279; f90: 538; asm: 471; lisp: 375; cs: 270; java: 266; fortran: 239; objc: 215; perl: 213; xml: 198; makefile: 108; javascript: 83; pascal: 63; tcl: 55; php: 25; ruby: 22
file content (2250 lines) | stat: -rw-r--r-- 84,994 bytes parent folder | download | duplicates (2)
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
.. cmake-manual-description: CMake File-Based API

cmake-file-api(7)
*****************

.. only:: html

   .. contents::

Introduction
============

CMake provides a file-based API that clients may use to get semantic
information about the buildsystems CMake generates.  Clients may use
the API by writing query files to a specific location in a build tree
to request zero or more `Object Kinds`_.  When CMake generates the
buildsystem in that build tree it will read the query files and write
reply files for the client to read.

The file-based API uses a ``<build>/.cmake/api/`` directory at the top
of a build tree.  The API is versioned to support changes to the layout
of files within the API directory.  API file layout versioning is
orthogonal to the versioning of `Object Kinds`_ used in replies.
This version of CMake supports only one API version, `API v1`_.

.. versionadded:: 3.27
  Projects may also submit queries for the current run using the
  :command:`cmake_file_api` command.

.. _`file-api v1`:

API v1
======

API v1 is housed in the ``<build>/.cmake/api/v1/`` directory.
It has the following subdirectories:

``query/``
  Holds query files written by clients.
  These may be `v1 Shared Stateless Query Files`_,
  `v1 Client Stateless Query Files`_, or `v1 Client Stateful Query Files`_.

``reply/``
  Holds reply files written by CMake when it runs to generate a build system.
  Clients may read reply files only when referenced by a reply index:

  ``index-*.json``
    A `v1 Reply Index File`_ written when CMake generates a build system.

  ``error-*.json``
    .. versionadded:: 4.1

    A `v1 Reply Error Index`_ written when CMake fails to generate a build
    system due to an error.

  Clients may look for and read a reply index at any time.
  Clients may optionally create the ``reply/`` directory at any time
  and monitor it for the appearance of a new reply index.
  CMake owns all reply files.  Clients must never remove them.

.. versionadded:: 3.31
  Users can add query files to ``api/v1/query`` inside the
  :envvar:`CMAKE_CONFIG_DIR` to create user-wide queries for all CMake projects.

v1 Shared Stateless Query Files
-------------------------------

Shared stateless query files allow clients to share requests for
major versions of the `Object Kinds`_ and get all requested versions
recognized by the CMake that runs.

Clients may create shared requests by creating empty files in the
``v1/query/`` directory.  The form is::

  <build>/.cmake/api/v1/query/<kind>-v<major>

where ``<kind>`` is one of the `Object Kinds`_, ``-v`` is literal,
and ``<major>`` is the major version number.

Files of this form are stateless shared queries not owned by any specific
client.  Once created they should not be removed without external client
coordination or human intervention.

v1 Client Stateless Query Files
-------------------------------

Client stateless query files allow clients to create owned requests for
major versions of the `Object Kinds`_ and get all requested versions
recognized by the CMake that runs.

Clients may create owned requests by creating empty files in
client-specific query subdirectories.  The form is::

  <build>/.cmake/api/v1/query/client-<client>/<kind>-v<major>

where ``client-`` is literal, ``<client>`` is a string uniquely
identifying the client, ``<kind>`` is one of the `Object Kinds`_,
``-v`` is literal, and ``<major>`` is the major version number.
Each client must choose a unique ``<client>`` identifier via its
own means.

Files of this form are stateless queries owned by the client ``<client>``.
The owning client may remove them at any time.

v1 Client Stateful Query Files
------------------------------

Stateful query files allow clients to request a list of versions of
each of the `Object Kinds`_ and get only the most recent version
recognized by the CMake that runs.

Clients may create owned stateful queries by creating ``query.json``
files in client-specific query subdirectories.  The form is::

  <build>/.cmake/api/v1/query/client-<client>/query.json

where ``client-`` is literal, ``<client>`` is a string uniquely
identifying the client, and ``query.json`` is literal.  Each client
must choose a unique ``<client>`` identifier via its own means.

``query.json`` files are stateful queries owned by the client ``<client>``.
The owning client may update or remove them at any time.  When a
given client installation is updated it may then update the stateful
query it writes to build trees to request newer object versions.
This can be used to avoid asking CMake to generate multiple object
versions unnecessarily.

.. versionadded:: 4.1
  The ``query.json`` file is described in machine-readable form by
  :download:`this JSON schema </manual/file_api/schema_stateful_query.json>`.

A ``query.json`` file must contain a JSON object:

.. code-block:: json

  {
    "requests": [
      { "kind": "<kind>" , "version": 1 },
      { "kind": "<kind>" , "version": { "major": 1, "minor": 2 } },
      { "kind": "<kind>" , "version": [2, 1] },
      { "kind": "<kind>" , "version": [2, { "major": 1, "minor": 2 }] },
      { "kind": "<kind>" , "version": 1, "client": {} },
      { "kind": "..." }
    ],
    "client": {}
  }

The members are:

``requests``
  A JSON array containing zero or more requests.  Each request is
  a JSON object with members:

  ``kind``
    Specifies one of the `Object Kinds`_ to be included in the reply.

  ``version``
    Indicates the version(s) of the object kind that the client
    understands.  Versions have major and minor components following
    semantic version conventions.  The value must be

    * a JSON integer specifying a (non-negative) major version number, or
    * a JSON object containing ``major`` and (optionally) ``minor``
      members specifying non-negative integer version components, or
    * a JSON array whose elements are each one of the above.

  ``client``
    Optional member reserved for use by the client.  This value is
    preserved in the reply written for the client in the
    `v1 Reply Index File`_ but is otherwise ignored.  Clients may use
    this to pass custom information with a request through to its reply.

  For each requested object kind CMake will choose the *first* version
  that it recognizes for that kind among those listed in the request.
  The response will use the selected *major* version with the highest
  *minor* version known to the running CMake for that major version.
  Therefore clients should list all supported major versions in
  preferred order along with the minimal minor version required
  for each major version.

``client``
  Optional member reserved for use by the client.  This value is
  preserved in the reply written for the client in the
  `v1 Reply Index File`_ but is otherwise ignored.  Clients may use
  this to pass custom information with a query through to its reply.

Other ``query.json`` top-level members are reserved for future use.
If present they are ignored for forward compatibility.

v1 Reply Index File
-------------------

CMake writes an ``index-*.json`` file to the ``v1/reply/`` directory
when it successfully generates a build system.  Clients must read the
reply index file first and may read other `v1 Reply Files`_ only by
following references.  The form of the reply index file name is::

  <build>/.cmake/api/v1/reply/index-<unspecified>.json

where ``index-`` is literal and ``<unspecified>`` is an unspecified
name selected by CMake.  Whenever a new index file is generated it
is given a new name and any old one is deleted.  During the short
time between these steps there may be multiple index files present;
the one with the largest name in lexicographic order is the current
index file.

.. versionadded:: 4.1
  The reply index file is described in machine-readable form by
  :download:`this JSON schema </manual/file_api/schema_index.json>`.

The reply index file contains a JSON object:

.. code-block:: json

  {
    "cmake": {
      "version": {
        "major": 3, "minor": 14, "patch": 0, "suffix": "",
        "string": "3.14.0", "isDirty": false
      },
      "paths": {
        "cmake": "/prefix/bin/cmake",
        "ctest": "/prefix/bin/ctest",
        "cpack": "/prefix/bin/cpack",
        "root": "/prefix/share/cmake-3.14"
      },
      "generator": {
        "multiConfig": false,
        "name": "Unix Makefiles"
      }
    },
    "objects": [
      { "kind": "<kind>",
        "version": { "major": 1, "minor": 0 },
        "jsonFile": "<file>" },
      { "...": "..." }
    ],
    "reply": {
      "<kind>-v<major>": { "kind": "<kind>",
                           "version": { "major": 1, "minor": 0 },
                           "jsonFile": "<file>" },
      "<unknown>": { "error": "unknown query file" },
      "...": {},
      "client-<client>": {
        "<kind>-v<major>": { "kind": "<kind>",
                             "version": { "major": 1, "minor": 0 },
                             "jsonFile": "<file>" },
        "<unknown>": { "error": "unknown query file" },
        "...": {},
        "query.json": {
          "requests": [ {}, {}, {} ],
          "responses": [
            { "kind": "<kind>",
              "version": { "major": 1, "minor": 0 },
              "jsonFile": "<file>" },
            { "error": "unknown query file" },
            { "...": {} }
          ],
          "client": {}
        }
      }
    }
  }

The members are:

``cmake``
  A JSON object containing information about the instance of CMake that
  generated the reply.  It contains members:

  ``version``
    A JSON object specifying the version of CMake with members:

    ``major``, ``minor``, ``patch``
      Integer values specifying the major, minor, and patch version components.
    ``suffix``
      A string specifying the version suffix, if any, e.g. ``g0abc3``.
    ``string``
      A string specifying the full version in the format
      ``<major>.<minor>.<patch>[-<suffix>]``.
    ``isDirty``
      A boolean indicating whether the version was built from a version
      controlled source tree with local modifications.

  ``paths``
    A JSON object specifying paths to things that come with CMake.
    It has members for :program:`cmake`, :program:`ctest`, and :program:`cpack`
    whose values are JSON strings specifying the absolute path to each tool,
    represented with forward slashes.  It also has a ``root`` member for
    the absolute path to the directory containing CMake resources like the
    ``Modules/`` directory (see :variable:`CMAKE_ROOT`).

  ``generator``
    A JSON object describing the CMake generator used for the build.
    It has members:

    ``multiConfig``
      A boolean specifying whether the generator supports multiple output
      configurations.
    ``name``
      A string specifying the name of the generator.
    ``platform``
      If the generator supports :variable:`CMAKE_GENERATOR_PLATFORM`,
      this is a string specifying the generator platform name.

``objects``
  A JSON array listing all versions of all `Object Kinds`_ generated
  as part of the reply.  Each array entry is a
  `v1 Reply File Reference`_.

``reply``
  A JSON object mirroring the content of the ``query/`` directory
  that CMake loaded to produce the reply.  The members are of the form

  ``<kind>-v<major>``
    A member of this form appears for each of the
    `v1 Shared Stateless Query Files`_ that CMake recognized as a
    request for object kind ``<kind>`` with major version ``<major>``.
    The value is

    * a `v1 Reply File Reference`_ to the corresponding reply file for
      that object kind and version, or
    * in a `v1 Reply Error Index`_, a JSON object with a single ``error``
      member containing a string with an error message.

  ``<unknown>``
    A member of this form appears for each of the
    `v1 Shared Stateless Query Files`_ that CMake did not recognize.
    The value is a JSON object with a single ``error`` member
    containing a string with an error message indicating that the
    query file is unknown.

  ``client-<client>``
    A member of this form appears for each client-owned directory
    holding `v1 Client Stateless Query Files`_.
    The value is a JSON object mirroring the content of the
    ``query/client-<client>/`` directory.  The members are of the form:

    ``<kind>-v<major>``
      A member of this form appears for each of the
      `v1 Client Stateless Query Files`_ that CMake recognized as a
      request for object kind ``<kind>`` with major version ``<major>``.
      The value is

      * a `v1 Reply File Reference`_ to the corresponding reply file for
        that object kind and version, or
      * in a `v1 Reply Error Index`_, a JSON object with a single ``error``
        member containing a string with an error message.

    ``<unknown>``
      A member of this form appears for each of the
      `v1 Client Stateless Query Files`_ that CMake did not recognize.
      The value is a JSON object with a single ``error`` member
      containing a string with an error message indicating that the
      query file is unknown.

    ``query.json``
      This member appears for clients using
      `v1 Client Stateful Query Files`_.
      If the ``query.json`` file failed to read or parse as a JSON object,
      this member is a JSON object with a single ``error`` member
      containing a string with an error message.  Otherwise, this member
      is a JSON object mirroring the content of the ``query.json`` file.
      The members are:

      ``client``
        A copy of the ``query.json`` file ``client`` member, if it exists.

      ``requests``
        A copy of the ``query.json`` file ``requests`` member, if it exists.

      ``responses``
        If the ``query.json`` file ``requests`` member is missing or invalid,
        this member is a JSON object with a single ``error`` member
        containing a string with an error message.  Otherwise, this member
        contains a JSON array with a response for each entry of the
        ``requests`` array, in the same order.  Each response is

        * a `v1 Reply File Reference`_ to the corresponding reply file for
          the requested object kind and selected version, or
        * a JSON object with a single ``error`` member containing a string
          with an error message.

After reading the reply index file, clients may read the other
`v1 Reply Files`_ it references.

v1 Reply File Reference
^^^^^^^^^^^^^^^^^^^^^^^

The reply index file represents each reference to another reply file
using a JSON object with members:

``kind``
  A string specifying one of the `Object Kinds`_.
``version``
  A JSON object with members ``major`` and ``minor`` specifying
  integer version components of the object kind.
``jsonFile``
  A JSON string specifying a path relative to the reply index file
  to another JSON file containing the object.

.. _`file-api reply error index`:

v1 Reply Error Index
^^^^^^^^^^^^^^^^^^^^

.. versionadded:: 4.1

CMake writes an ``error-*.json`` file to the ``v1/reply/`` directory
when it fails to generate a build system.  This reply error index
follows the same naming pattern, syntax, and semantics of a
`v1 Reply Index File`_, with the following exceptions:

* The ``index-`` prefix is replaced by an ``error-`` prefix.

* When a new error index is generated, old index files are *not*
  deleted.  If a `v1 Reply Index File`_ exists, it indexes replies
  from the most recent successful run.  If multiple ``index-*.json``
  and/or ``error-*.json`` files are present, the one with the largest
  name in lexicographic order, excluding the ``index-`` or ``error-``
  prefix, is the current index.

* Only a subset of `Object Kinds`_ are provided:

  `configureLog <file-api configureLog_>`_
    .. versionadded:: 4.1

  Index entries for other object kinds contain an ``error`` message
  instead of a `v1 Reply File Reference`_.

v1 Reply Files
--------------

Reply files containing specific `Object Kinds`_ are written by CMake.
The names of these files are unspecified and must not be interpreted
by clients.  Clients must first read the `v1 Reply Index File`_ and
follow references to the names of the desired response objects.

Reply files (including the index file) will never be replaced by
files of the same name but different content.  This allows a client
to read the files concurrently with a running CMake that may generate
a new reply.  However, after generating a new reply CMake will attempt
to remove reply files from previous runs that it did not just write.
If a client attempts to read a reply file referenced by the index but
finds the file missing, that means a concurrent CMake has generated
a new reply.  The client may simply start again by reading the new
reply index file.

.. _`file-api object kinds`:

Object Kinds
============

The CMake file-based API reports semantic information about the build
system using the following kinds of JSON objects.  Each kind of object
is versioned independently using semantic versioning with major and
minor components.  Every kind of object has the form:

.. code-block:: json

  {
    "kind": "<kind>",
    "version": { "major": 1, "minor": 0 },
    "...": {}
  }

The ``kind`` member is a string specifying the object kind name.
The ``version`` member is a JSON object with ``major`` and ``minor``
members specifying integer components of the object kind's version.
Additional top-level members are specific to each object kind.

Object Kind "codemodel"
-----------------------

The ``codemodel`` object kind describes the build system structure as
modeled by CMake.

There is only one ``codemodel`` object major version, version 2.
Version 1 does not exist to avoid confusion with that from
:manual:`cmake-server(7)` mode.

.. versionadded:: 4.1
  The ``codemodel`` object kind reply is described in machine-readable form
  by :download:`this JSON schema </manual/file_api/schema_codemodel.json>`.

"codemodel" version 2
^^^^^^^^^^^^^^^^^^^^^

``codemodel`` object version 2 is a JSON object:

.. code-block:: json

  {
    "kind": "codemodel",
    "version": { "major": 2, "minor": 8 },
    "paths": {
      "source": "/path/to/top-level-source-dir",
      "build": "/path/to/top-level-build-dir"
    },
    "configurations": [
      {
        "name": "Debug",
        "directories": [
          {
            "source": ".",
            "build": ".",
            "childIndexes": [ 1 ],
            "projectIndex": 0,
            "targetIndexes": [ 0 ],
            "abstractTargetIndexes": [ 1 ],
            "hasInstallRule": true,
            "minimumCMakeVersion": {
              "string": "3.14"
            },
            "jsonFile": "<file>"
          },
          {
            "source": "sub",
            "build": "sub",
            "parentIndex": 0,
            "projectIndex": 0,
            "targetIndexes": [ 1 ],
            "abstractTargetIndexes": [ 0 ],
            "minimumCMakeVersion": {
              "string": "3.14"
            },
            "jsonFile": "<file>"
          }
        ],
        "projects": [
          {
            "name": "MyProject",
            "directoryIndexes": [ 0, 1 ],
            "targetIndexes": [ 0, 1 ],
            "abstractTargetIndexes": [ 0, 1 ],
          }
        ],
        "targets": [
          {
            "name": "MyExecutable",
            "directoryIndex": 0,
            "projectIndex": 0,
            "jsonFile": "<file>"
          },
          {
            "name": "MyLibrary",
            "directoryIndex": 1,
            "projectIndex": 0,
            "jsonFile": "<file>"
          }
        ]
        "abstractTargets": [
          {
            "name": "MyImportedExecutable",
            "directoryIndex": 1,
            "projectIndex": 0,
            "jsonFile": "<file>"
          },
          {
            "name": "MyPureInterfaceLibrary",
            "directoryIndex": 0,
            "projectIndex": 0,
            "jsonFile": "<file>"
          }
        ]
      }
    ]
  }

The members specific to ``codemodel`` objects are:

``paths``
  A JSON object containing members:

  ``source``
    A string specifying the absolute path to the top-level source directory,
    represented with forward slashes.

  ``build``
    A string specifying the absolute path to the top-level build directory,
    represented with forward slashes.

``configurations``
  A JSON array of entries corresponding to available build configurations.
  On single-configuration generators there is one entry for the value
  of the :variable:`CMAKE_BUILD_TYPE` variable.  For multi-configuration
  generators there is an entry for each configuration listed in the
  :variable:`CMAKE_CONFIGURATION_TYPES` variable.
  Each entry is a JSON object containing members:

  ``name``
    A string specifying the name of the configuration, e.g. ``Debug``.

  ``directories``
    A JSON array of entries each corresponding to a build system directory
    whose source directory contains a ``CMakeLists.txt`` file.  The first
    entry corresponds to the top-level directory.  Each entry is a
    JSON object containing members:

    ``source``
      A string specifying the path to the source directory, represented
      with forward slashes.  If the directory is inside the top-level
      source directory then the path is specified relative to that
      directory (with ``.`` for the top-level source directory itself).
      Otherwise the path is absolute.

    ``build``
      A string specifying the path to the build directory, represented
      with forward slashes.  If the directory is inside the top-level
      build directory then the path is specified relative to that
      directory (with ``.`` for the top-level build directory itself).
      Otherwise the path is absolute.

    ``parentIndex``
      Optional member that is present when the directory is not top-level.
      The value is an unsigned integer 0-based index of another entry in
      the main ``directories`` array that corresponds to the parent
      directory that added this directory as a subdirectory.

    ``childIndexes``
      Optional member that is present when the directory has subdirectories.
      The value is a JSON array of entries corresponding to child directories
      created by the :command:`add_subdirectory` or :command:`subdirs`
      command.  Each entry is an unsigned integer 0-based index of another
      entry in the main ``directories`` array.

    ``projectIndex``
      An unsigned integer 0-based index into the main ``projects`` array
      indicating the build system project to which the this directory belongs.

    ``targetIndexes``
      Optional member that is present when the directory itself has
      build system targets, excluding those belonging to subdirectories.
      The value is a JSON array of entries corresponding to the build system
      targets.  Each entry is an unsigned integer 0-based index into the main
      ``targets`` array.

    ``abstractTargetIndexes``
      Optional member that is present when the directory itself has abstract
      targets, excluding those belonging to subdirectories.
      The value is a JSON array of entries corresponding to the abstract
      targets.  Each entry is an unsigned integer 0-based index into the main
      ``abstractTargets`` array.

      This field was added in codemodel version 2.9.

    ``minimumCMakeVersion``
      Optional member present when a minimum required version of CMake is
      known for the directory.  This is the ``<min>`` version given to the
      most local call to the :command:`cmake_minimum_required(VERSION)`
      command in the directory itself or one of its ancestors.
      The value is a JSON object with one member:

      ``string``
        A string specifying the minimum required version in the format::

          <major>.<minor>[.<patch>[.<tweak>]][<suffix>]

        Each component is an unsigned integer and the suffix may be an
        arbitrary string.

    ``hasInstallRule``
      Optional member that is present with boolean value ``true`` when
      the directory or one of its subdirectories contains any
      :command:`install` rules, i.e. whether a ``make install``
      or equivalent rule is available.

    ``jsonFile``
      A JSON string specifying a path relative to the codemodel file
      to another JSON file containing a
      `"codemodel" version 2 "directory" object`_.

      This field was added in codemodel version 2.3.

  ``projects``
    A JSON array of entries corresponding to the top-level project
    and sub-projects defined in the build system.  Each (sub-)project
    corresponds to a source directory whose ``CMakeLists.txt`` file
    calls the :command:`project` command with a project name different
    from its parent directory.  The first entry corresponds to the
    top-level project.

    Each entry is a JSON object containing members:

    ``name``
      A string specifying the name given to the :command:`project` command.

    ``parentIndex``
      Optional member that is present when the project is not top-level.
      The value is an unsigned integer 0-based index of another entry in
      the main ``projects`` array that corresponds to the parent project
      that added this project as a sub-project.

    ``childIndexes``
      Optional member that is present when the project has sub-projects.
      The value is a JSON array of entries corresponding to the sub-projects.
      Each entry is an unsigned integer 0-based index of another
      entry in the main ``projects`` array.

    ``directoryIndexes``
      A JSON array of entries corresponding to build system directories
      that are part of the project.  The first entry corresponds to the
      top-level directory of the project.  Each entry is an unsigned
      integer 0-based index into the main ``directories`` array.

    ``targetIndexes``
      Optional member that is present when the project itself has
      build system targets, excluding those belonging to sub-projects.
      The value is a JSON array of entries corresponding to the build system
      targets.  Each entry is an unsigned integer 0-based index into the main
      ``targets`` array.

    ``abstractTargetIndexes``
      Optional member that is present when the project itself has
      abstract targets, excluding those belonging to sub-projects.
      The value is a JSON array of entries corresponding to the abstract
      targets.  Each entry is an unsigned integer 0-based index into the main
      ``abstractTargets`` array.

      This field was added in codemodel version 2.9.

  ``targets``
    A JSON array of entries corresponding to the build system targets.
    Such targets are created by calls to :command:`add_executable`,
    :command:`add_library`, and :command:`add_custom_target`, excluding
    imported targets and interface libraries that do not generate any
    build rules.  Each entry is a JSON object containing members:

    ``name``
      A string specifying the target name.

    ``id``
      A string uniquely identifying the target.  This matches the ``id``
      field in the file referenced by ``jsonFile``.

    ``directoryIndex``
      An unsigned integer 0-based index into the main ``directories`` array
      indicating the build system directory in which the target is defined.

    ``projectIndex``
      An unsigned integer 0-based index into the main ``projects`` array
      indicating the build system project in which the target is defined.

    ``jsonFile``
      A JSON string specifying a path relative to the codemodel file
      to another JSON file containing a
      `"codemodel" version 2 "target" object`_.

  ``abstractTargets``
    A JSON array of entries corresponding to targets that are not present
    in the build system.  These are imported targets or interface libraries
    created by calls to :command:`add_executable` or :command:`add_library`.
    In the case of interface libraries, only those that are not part of the
    build system are included in this array.  Interface libraries that do
    participate in the build system will be included in the ``targets``
    array instead.

    Each entry is a JSON object containing members:

    ``name``
      A string specifying the target name.

    ``id``
      A string uniquely identifying the target.  This matches the ``id``
      field in the file referenced by ``jsonFile``.

    ``directoryIndex``
      An unsigned integer 0-based index into the main ``directories`` array
      indicating the build system directory in which the target is defined.

    ``projectIndex``
      An unsigned integer 0-based index into the main ``projects`` array
      indicating the build system project in which the target is defined.

    ``jsonFile``
      A JSON string specifying a path relative to the codemodel file
      to another JSON file containing a
      `"codemodel" version 2 "target" object`_.

    This field was added in codemodel version 2.9.

"codemodel" version 2 "directory" object
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. versionadded:: 4.1
  The ``directory`` object reply is described in machine-readable form by
  :download:`this JSON schema </manual/file_api/schema_directory.json>`.

A codemodel "directory" object is referenced by a `"codemodel" version 2`_
object's ``directories`` array.  Each "directory" object is a JSON object
with members:

``codemodelVersion``
  This specifies the codemodel version this file is part of.  It will match
  the ``version`` field of the codemodel object kind that references this file.
  It is a JSON object with the following members:

  ``major``
    The codemodel major version.

  ``minor``
    The codemodel minor version.

  This field was added in codemodel version 2.9.

``paths``
  A JSON object containing members:

  ``source``
    A string specifying the path to the source directory, represented
    with forward slashes.  If the directory is inside the top-level
    source directory then the path is specified relative to that
    directory (with ``.`` for the top-level source directory itself).
    Otherwise the path is absolute.

  ``build``
    A string specifying the path to the build directory, represented
    with forward slashes.  If the directory is inside the top-level
    build directory then the path is specified relative to that
    directory (with ``.`` for the top-level build directory itself).
    Otherwise the path is absolute.

``installers``
  A JSON array of entries corresponding to :command:`install` rules.
  Each entry is a JSON object containing members:

  ``component``
    A string specifying the component selected by the corresponding
    :command:`install` command invocation.

  ``destination``
    Optional member that is present for specific ``type`` values below.
    The value is a string specifying the install destination path.
    The path may be absolute or relative to the install prefix.

  ``paths``
    Optional member that is present for specific ``type`` values below.
    The value is a JSON array of entries corresponding to the paths
    (files or directories) to be installed.  Each entry is one of:

    * A string specifying the path from which a file or directory
      is to be installed.  The portion of the path not preceded by
      a ``/`` also specifies the path (name) to which the file
      or directory is to be installed under the destination.

    * A JSON object with members:

      ``from``
        A string specifying the path from which a file or directory
        is to be installed.

      ``to``
        A string specifying the path to which the file or directory
        is to be installed under the destination.

    In both cases the paths are represented with forward slashes.  If
    the "from" path is inside the top-level directory documented by the
    corresponding ``type`` value, then the path is specified relative
    to that directory.  Otherwise the path is absolute.

  ``type``
    A string specifying the type of installation rule.  The value is one
    of the following, with some variants providing additional members:

    ``file``
      An :command:`install(FILES)` or :command:`install(PROGRAMS)` call.
      The ``destination`` and ``paths`` members are populated, with paths
      under the top-level *source* directory expressed relative to it.
      The ``isOptional`` member may exist.
      This type has no additional members.

    ``directory``
      An :command:`install(DIRECTORY)` call.
      The ``destination`` and ``paths`` members are populated, with paths
      under the top-level *source* directory expressed relative to it.
      The ``isOptional`` member may exist.
      This type has no additional members.

    ``target``
      An :command:`install(TARGETS)` call.
      The ``destination`` and ``paths`` members are populated, with paths
      under the top-level *build* directory expressed relative to it.
      The ``isOptional`` member may exist.
      This type has additional members ``targetId``, ``targetIndex``,
      ``targetIsImportLibrary``, and ``targetInstallNamelink``.

    ``export``
      An :command:`install(EXPORT)` call.
      The ``destination`` and ``paths`` members are populated, with paths
      under the top-level *build* directory expressed relative to it.
      The ``paths`` entries refer to files generated automatically by
      CMake for installation, and their actual values are considered
      private implementation details.
      This type has additional members ``exportName`` and ``exportTargets``.

    ``script``
      An :command:`install(SCRIPT)` call.
      This type has additional member ``scriptFile``.

    ``code``
      An :command:`install(CODE)` call.
      This type has no additional members.

    ``importedRuntimeArtifacts``
      An :command:`install(IMPORTED_RUNTIME_ARTIFACTS)` call.
      The ``destination`` member is populated. The ``isOptional`` member may
      exist. This type has no additional members.

    ``runtimeDependencySet``
      An :command:`install(RUNTIME_DEPENDENCY_SET)` call or an
      :command:`install(TARGETS)` call with ``RUNTIME_DEPENDENCIES``. The
      ``destination`` member is populated. This type has additional members
      ``runtimeDependencySetName`` and ``runtimeDependencySetType``.

    ``fileSet``
      An :command:`install(TARGETS)` call with ``FILE_SET``.
      The ``destination`` and ``paths`` members are populated.
      The ``isOptional`` member may exist.
      This type has additional members ``fileSetName``, ``fileSetType``,
      ``fileSetDirectories``, and ``fileSetTarget``.

      This type was added in codemodel version 2.4.

    ``cxxModuleBmi``
      An :command:`install(TARGETS)` call with ``CXX_MODULES_BMI``.
      The ``destination`` member is populated and the ``isOptional`` member
      may exist.  This type has an additional ``cxxModuleBmiTarget`` member.

      This type was added in codemodel version 2.5.

  ``isExcludeFromAll``
    Optional member that is present with boolean value ``true`` when
    :command:`install` is called with the ``EXCLUDE_FROM_ALL`` option.

  ``isForAllComponents``
    Optional member that is present with boolean value ``true`` when
    :command:`install(SCRIPT|CODE)` is called with the
    ``ALL_COMPONENTS`` option.

  ``isOptional``
    Optional member that is present with boolean value ``true`` when
    :command:`install` is called with the ``OPTIONAL`` option.
    This is allowed when ``type`` is ``file``, ``directory``, or ``target``.

  ``targetId``
    Optional member that is present when ``type`` is ``target``.
    The value is a string uniquely identifying the target to be installed.
    This matches the ``id`` member of the target in the main
    "codemodel" object's ``targets`` array.

  ``targetIndex``
    Optional member that is present when ``type`` is ``target``.
    The value is an unsigned integer 0-based index into the main "codemodel"
    object's ``targets`` array for the target to be installed.

  ``targetIsImportLibrary``
    Optional member that is present when ``type`` is ``target`` and
    the installer is for a Windows DLL import library file or for an
    AIX linker import file.  If present, it has boolean value ``true``.

  ``targetInstallNamelink``
    Optional member that is present when ``type`` is ``target`` and
    the installer corresponds to a target that may use symbolic links
    to implement the :prop_tgt:`VERSION` and :prop_tgt:`SOVERSION`
    target properties.
    The value is a string indicating how the installer is supposed to
    handle the symlinks: ``skip`` means the installer should skip the
    symlinks and install only the real file, and ``only`` means the
    installer should install only the symlinks and not the real file.
    In all cases the ``paths`` member lists what it actually installs.

  ``exportName``
    Optional member that is present when ``type`` is ``export``.
    The value is a string specifying the name of the export.

  ``exportTargets``
    Optional member that is present when ``type`` is ``export``.
    The value is a JSON array of entries corresponding to the targets
    included in the export.  Each entry is a JSON object with members:

    ``id``
      A string uniquely identifying the target.  This matches
      the ``id`` member of the target in the main "codemodel"
      object's ``targets`` array.

    ``index``
      An unsigned integer 0-based index into the main "codemodel"
      object's ``targets`` array for the target.

  ``runtimeDependencySetName``
    Optional member that is present when ``type`` is ``runtimeDependencySet``
    and the installer was created by an
    :command:`install(RUNTIME_DEPENDENCY_SET)` call. The value is a string
    specifying the name of the runtime dependency set that was installed.

  ``runtimeDependencySetType``
    Optional member that is present when ``type`` is ``runtimeDependencySet``.
    The value is a string with one of the following values:

    ``library``
      Indicates that this installer installs dependencies that are not macOS
      frameworks.

    ``framework``
      Indicates that this installer installs dependencies that are macOS
      frameworks.

  ``fileSetName``
    Optional member that is present when ``type`` is ``fileSet``. The value is
    a string with the name of the file set.

    This field was added in codemodel version 2.4.

  ``fileSetType``
    Optional member that is present when ``type`` is ``fileSet``. The value is
    a string with the type of the file set.

    This field was added in codemodel version 2.4.

  ``fileSetDirectories``
    Optional member that is present when ``type`` is ``fileSet``. The value
    is a list of strings with the file set's base directories (determined by
    genex-evaluation of :prop_tgt:`HEADER_DIRS` or
    :prop_tgt:`HEADER_DIRS_<NAME>`).

    This field was added in codemodel version 2.4.

  ``fileSetTarget``
    Optional member that is present when ``type`` is ``fileSet``. The value
    is a JSON object with members:

    ``id``
      A string uniquely identifying the target.  This matches
      the ``id`` member of the target in the main "codemodel"
      object's ``targets`` array.

    ``index``
      An unsigned integer 0-based index into the main "codemodel"
      object's ``targets`` array for the target.

    This field was added in codemodel version 2.4.

  ``cxxModuleBmiTarget``
    Optional member that is present when ``type`` is ``cxxModuleBmi``.
    The value is a JSON object with members:

    ``id``
      A string uniquely identifying the target.  This matches
      the ``id`` member of the target in the main "codemodel"
      object's ``targets`` array.

    ``index``
      An unsigned integer 0-based index into the main "codemodel"
      object's ``targets`` array for the target.

    This field was added in codemodel version 2.5.

  ``scriptFile``
    Optional member that is present when ``type`` is ``script``.
    The value is a string specifying the path to the script file on disk,
    represented with forward slashes.  If the file is inside the top-level
    source directory then the path is specified relative to that directory.
    Otherwise the path is absolute.

  ``backtrace``
    Optional member that is present when a CMake language backtrace to
    the :command:`install` or other command invocation that added this
    installer is available.  The value is an unsigned integer 0-based
    index into the ``backtraceGraph`` member's ``nodes`` array.

``backtraceGraph``
  A `"codemodel" version 2 "backtrace graph"`_ whose nodes are referenced
  from ``backtrace`` members elsewhere in this "directory" object.

"codemodel" version 2 "target" object
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. versionadded:: 4.1
  The ``target`` object reply is described in machine-readable form by
  :download:`this JSON schema </manual/file_api/schema_target.json>`.

A codemodel "target" object is referenced by a `"codemodel" version 2`_
object's ``targets`` array.  Each "target" object is a JSON object
with members:

``codemodelVersion``
  This specifies the codemodel version this file is part of.  It will match
  the ``version`` field of the codemodel object kind that references this file.
  It is a JSON object with the following members:

  ``major``
    The codemodel major version.

  ``minor``
    The codemodel minor version.

  This field was added in codemodel version 2.9.

``name``
  A string specifying the logical name of the target.

``id``
  A string uniquely identifying the target.  The format is unspecified
  and should not be interpreted by clients.

``type``
  A string specifying the type of the target.  The value is one of
  ``EXECUTABLE``, ``STATIC_LIBRARY``, ``SHARED_LIBRARY``,
  ``MODULE_LIBRARY``, ``OBJECT_LIBRARY``, ``INTERFACE_LIBRARY``,
  or ``UTILITY``.

``imported``
  Optional member that is present with boolean value ``true`` if the
  target is an imported target.

  This field was added in codemodel version 2.9.

``local``
  Optional member that is present with boolean value ``true`` if the
  target is only defined with local scope rather than being a global target.
  Currently, only imported targets will potentially have this field.

  This field was added in codemodel version 2.9.

``abstract``
  Optional member that is present with boolean value ``true`` if the
  target is an abstract target.  Abstract targets are not part of the build
  system, they only exist to describe dependencies or to provide usage
  requirements to targets that link to them.  Examples include imported targets
  and interface libraries that have no generated sources.  Abstract targets
  cannot be built, so they should not be presented to the user as a buildable
  target.

  This field was added in codemodel version 2.9.  Abstract targets were not
  included in codemodel version 2.8 and earlier.

``symbolic``
  Optional member that is present with boolean value ``true`` if the target
  is :prop_tgt:`SYMBOLIC`.  Symbolic targets are created by calls to
  :command:`add_library(INTERFACE SYMBOLIC) <add_library(INTERFACE-SYMBOLIC)>`,
  and are also abstract targets that are not part of the build system.

  This field was added in codemodel version 2.9.  Symbolic targets were not
  included in codemodel version 2.8 and earlier.

``backtrace``
  Optional member that is present when a CMake language backtrace to
  the command in the source code that created the target is available.
  The value is an unsigned integer 0-based index into the
  ``backtraceGraph`` member's ``nodes`` array.

``folder``
  Optional member that is present when the :prop_tgt:`FOLDER` target
  property is set.  The value is a JSON object with one member:

  ``name``
    A string specifying the name of the target folder.

``paths``
  A JSON object containing members:

  ``source``
    A string specifying the path to the target's source directory,
    represented with forward slashes.  If the directory is inside the
    top-level source directory then the path is specified relative to
    that directory (with ``.`` for the top-level source directory itself).
    Otherwise the path is absolute.

  ``build``
    A string specifying the path to the target's build directory,
    represented with forward slashes.  If the directory is inside the
    top-level build directory then the path is specified relative to
    that directory (with ``.`` for the top-level build directory itself).
    Otherwise the path is absolute.

``nameOnDisk``
  Optional member that is present for executable and library targets
  that are linked or archived into a single primary artifact.
  The value is a string specifying the file name of that artifact on disk.

``artifacts``
  Optional member that is present for executable and library targets
  that produce artifacts on disk meant for consumption by dependents.
  The value is a JSON array of entries corresponding to the artifacts.
  Each entry is a JSON object containing one member:

  ``path``
    A string specifying the path to the file on disk, represented with
    forward slashes.  If the file is inside the top-level build directory
    then the path is specified relative to that directory.
    Otherwise the path is absolute.

``isGeneratorProvided``
  Optional member that is present with boolean value ``true`` if the
  target is provided by CMake's build system generator rather than by
  a command in the source code.

``install``
  Optional member that is present when the target has an :command:`install`
  rule.  The value is a JSON object with members:

  ``prefix``
    A JSON object specifying the installation prefix.  It has one member:

    ``path``
      A string specifying the value of :variable:`CMAKE_INSTALL_PREFIX`.

  ``destinations``
    A JSON array of entries specifying an install destination path.
    Each entry is a JSON object with members:

    ``path``
      A string specifying the install destination path.  The path may
      be absolute or relative to the install prefix.

    ``backtrace``
      Optional member that is present when a CMake language backtrace to
      the :command:`install` command invocation that specified this
      destination is available.  The value is an unsigned integer 0-based
      index into the ``backtraceGraph`` member's ``nodes`` array.

``launchers``
  Optional member that is present on executable targets that have
  at least one launcher specified by the project.  The value is a
  JSON array of entries corresponding to the specified launchers.
  Each entry is a JSON object with members:

  ``command``
    A string specifying the path to the launcher on disk, represented
    with forward slashes. If the file is inside the top-level source
    directory then the path is specified relative to that directory.

  ``arguments``
    Optional member that is present when the launcher command has
    arguments preceding the executable to be launched.  The value
    is a JSON array of strings representing the arguments.

  ``type``
    A string specifying the type of launcher.  The value is one of
    the following:

    ``emulator``
      An emulator for the target platform when cross-compiling.
      See the :prop_tgt:`CROSSCOMPILING_EMULATOR` target property.

    ``test``
      A start program for the execution of tests.
      See the :prop_tgt:`TEST_LAUNCHER` target property.

  This field was added in codemodel version 2.7.

``link``
  Optional member that is present for non-imported executables and shared
  library targets that link into a runtime binary.  The value is a JSON object
  with members describing the link step:

  ``language``
    A string specifying the language (e.g. ``C``, ``CXX``, ``Fortran``)
    of the toolchain is used to invoke the linker.

  ``commandFragments``
    Optional member that is present when fragments of the link command
    line invocation are available.  The value is a JSON array of entries
    specifying ordered fragments.  Each entry is a JSON object with members:

    ``fragment``
      A string specifying a fragment of the link command line invocation.
      The value is encoded in the build system's native shell format.

    ``role``
      A string specifying the role of the fragment's content:

      * ``flags``: link flags.
      * ``libraries``: link library file paths or flags.
      * ``libraryPath``: library search path flags.
      * ``frameworkPath``: macOS framework search path flags.

    ``backtrace``
      Optional member that is present when a CMake language backtrace to
      the :command:`target_link_libraries`, :command:`target_link_options`,
      or other command invocation that added this link fragment is available.
      The value is an unsigned integer 0-based index into the ``backtraceGraph``
      member's ``nodes`` array.

  ``lto``
    Optional member that is present with boolean value ``true``
    when link-time optimization (a.k.a. interprocedural optimization
    or link-time code generation) is enabled.

  ``sysroot``
    Optional member that is present when the :variable:`CMAKE_SYSROOT_LINK`
    or :variable:`CMAKE_SYSROOT` variable is defined.  The value is a
    JSON object with one member:

    ``path``
      A string specifying the absolute path to the sysroot, represented
      with forward slashes.

``archive``
  Optional member that is present for non-imported static library targets.
  The value is a JSON object with members describing the archive step:

  ``commandFragments``
    Optional member that is present when fragments of the archiver command
    line invocation are available.  The value is a JSON array of entries
    specifying the fragments.  Each entry is a JSON object with members:

    ``fragment``
      A string specifying a fragment of the archiver command line invocation.
      The value is encoded in the build system's native shell format.

    ``role``
      A string specifying the role of the fragment's content:

      * ``flags``: archiver flags.

  ``lto``
    Optional member that is present with boolean value ``true``
    when link-time optimization (a.k.a. interprocedural optimization
    or link-time code generation) is enabled.

``debugger``
  Optional member that is present when the target has one of the
  following fields set.
  The value is a JSON object of entries corresponding to
  debugger specific values set.

  This field was added in codemodel version 2.8.

  ``workingDirectory``
    Optional member that is present when the
    :prop_tgt:`DEBUGGER_WORKING_DIRECTORY` target property is set.
    The member will also be present in :ref:`Visual Studio Generators`
    when :prop_tgt:`VS_DEBUGGER_WORKING_DIRECTORY` is set.

    This field was added in codemodel version 2.8.

``dependencies``
  Optional member that is present when the target depends on other targets.
  It is only present if the target is part of the build system.
  Imported targets are not part of the build system.  Interface libraries
  are only part of the build system if they have sources or file sets.

  The value is a JSON array of entries corresponding to the build dependencies.
  The array includes not just direct dependencies, but also transitive
  dependencies.  All listed targets will build before this one.

  The list of dependencies reflects the *build graph* dependencies, not
  necessarily the link dependencies.  If there are cycles in the link
  dependencies of static libraries, not all link dependencies will be
  reflected in this list of build graph dependencies.

  Each entry is a JSON object with members:

  ``id``
    A string uniquely identifying the target on which this target depends.
    This matches the main ``id`` member of the other target.

  ``backtrace``
    Optional member that is present when a CMake language backtrace to
    the :command:`add_dependencies`, :command:`target_link_libraries`,
    or other command invocation that created this dependency is
    available.  The value is an unsigned integer 0-based index into
    the ``backtraceGraph`` member's ``nodes`` array.

``linkLibraries``
  Optional member that may be present when the target links directly to one or
  more other targets or libraries.  It contains items that are used when
  linking this target.  These come from the target's
  :prop_tgt:`LINK_LIBRARIES` property (evaluated non-transitively), or the
  :prop_tgt:`INTERFACE_LINK_LIBRARIES_DIRECT` property of another target it
  links to directly or transitively.

  Items that are only applied as usage requirements (such as being wrapped in a
  :genex:`$<COMPILE_ONLY:...>` expression) will not be present in this member.

  The value is a JSON array of entries.  Each entry is a JSON object with
  members:

  ``id``
    Optional member that is present when the library to be linked is a target.
    It uniquely identifies the target on which this one has a direct link
    relationship.  This matches the main ``id`` member of that other target.

    The target this ``id`` identifies is not necessarily part of the build
    system.  It may be an imported target or an interface library with no
    sources or file sets.

    Exactly one of ``id`` or ``fragment`` will always be present.

  ``fragment``
    Optional member that is present when the library to be linked is not a
    target.  It is a string containing the raw linker command line arguments
    that capture the relationship.  These will typically be linking to
    libraries or frameworks by name rather than as a target.

    Exactly one of ``id`` or ``fragment`` will always be present.

  ``backtrace``
    Optional member that is present when a CMake language backtrace to
    the command invocation that created this relationship is available.
    The value is an unsigned integer 0-based index into the
    ``backtraceGraph`` member's ``nodes`` array.

  ``fromDependency``
    Optional member that is only present when the relationship is the result of
    an :prop_tgt:`INTERFACE_LINK_LIBRARIES_DIRECT` target property on one of
    this target's directly or transitively linked libraries.  It is a JSON
    object with one member:

    ``id``
      A string uniquely identifying the target whose
      :prop_tgt:`INTERFACE_LINK_LIBRARIES_DIRECT` property created the
      relationship.  The value matches the main ``id`` member of that target.

  This field was added in codemodel version 2.9.

``interfaceLinkLibraries``
  Optional member that may be present when the target has one or more interface
  link libraries.  It contains items that are used when linking consumers of
  this target.  These come from the target's
  :prop_tgt:`INTERFACE_LINK_LIBRARIES` property.

  Items that are only applied as usage requirements (such as being wrapped in a
  :genex:`$<COMPILE_ONLY:...>` expression) will not be present in this member.

  The value is a JSON array of entries.  Each entry is a JSON object with
  members:

  ``id``
    Optional member that is present when the interface link library is for a
    target.  It uniquely identifies that target, with the value matching the
    main ``id`` member of that target.

    The target this ``id`` identifies is not necessarily part of the build
    system.  It may be an imported target or an interface library with no
    sources or file sets.

    Exactly one of ``id`` or ``fragment`` will always be present.

  ``fragment``
    Optional member that is present when the interface link library is not for
    a target.  It is a string containing the raw linker command line arguments
    to be applied to consumers of this target's interface link libraries.
    These will typically be linker arguments for linking to libraries or
    frameworks by name rather than as a target.

    Exactly one of ``id`` or ``fragment`` will always be present.

  ``backtrace``
    Optional member that is present when a CMake language backtrace to the
    command invocation that created this interface relationship is available.
    The value is an unsigned integer 0-based index into the
    ``backtraceGraph`` member's ``nodes`` array.

  This field was added in codemodel version 2.9.

``compileDependencies``
  Optional member that may be present when the target links directly to one or
  more other targets that may provide usage requirements to this one.  They
  affect how this target's sources are compiled.  These relationships are
  defined by the target's :prop_tgt:`LINK_LIBRARIES` property (evaluated
  non-transitively) and the :prop_tgt:`INTERFACE_LINK_LIBRARIES_DIRECT`
  property of other targets it links to directly or transitively.

  Relationships that only apply linking requirements (such as being wrapped
  in a :genex:`$<LINK_ONLY:...>` expression) will not be present in this
  member.

  The value is a JSON array of entries.  Each entry is a JSON object with
  members:

  ``id``
    A string uniquely identifying the target on which this target directly
    depends.  This matches the main ``id`` member of the other target.

    The target this ``id`` identifies is not necessarily part of the build
    system.  It may be an imported target or an interface library with no
    sources or file sets.

  ``backtrace``
    Optional member that is present when a CMake language backtrace to
    the command invocation that created this relationship is available.
    The value is an unsigned integer 0-based index into the
    ``backtraceGraph`` member's ``nodes`` array.

  ``fromDependency``
    Optional member that is only present when the relationship is the result of
    an :prop_tgt:`INTERFACE_LINK_LIBRARIES_DIRECT` target property on one of
    this target's directly or transitively linked libraries.  It is a JSON
    object with one member:

    ``id``
      A string uniquely identifying the target whose
      :prop_tgt:`INTERFACE_LINK_LIBRARIES_DIRECT` property created the
      relationship.  The value matches the main ``id`` member of that target.

  This field was added in codemodel version 2.9.

``interfaceCompileDependencies``
  Optional member that may be present when the target has one or more interface
  linking relationships to other targets.  It contains items that affect how
  consumers' sources are compiled.  These relationships are defined by the
  target's :prop_tgt:`INTERFACE_LINK_LIBRARIES` property.

  Relationships that only apply linking requirements (such as being wrapped
  in a :genex:`$<LINK_ONLY:...>` expression) will not be present in this
  member.

  The value is a JSON array of entries.  Each entry is a JSON object with
  members:

  ``id``
    A string uniquely identifying the target on which this target specifies
    an interface relationship.  This matches the main ``id`` member of the
    other target.

    The target this ``id`` identifies is not necessarily part of the build
    system.  It may be an imported target or an interface library with no
    sources or file sets.

  ``backtrace``
    Optional member that is present when a CMake language backtrace to
    the command invocation that created this relationship is available.
    The value is an unsigned integer 0-based index into the
    ``backtraceGraph`` member's ``nodes`` array.

  This field was added in codemodel version 2.9.

``objectDependencies``
  Optional member that is present when the target has one or more entries in
  its :prop_tgt:`SOURCES` property where the entry is specified using
  :genex:`$<TARGET_OBJECTS:...>`, and where no other generator expression is
  used within the :genex:`$<TARGET_OBJECTS:...>` expression.

  The value is a JSON array of entries.  Each entry is a JSON object with
  members:

  ``id``
    A string uniquely identifying the target whose objects are referred to in
    the :genex:`$<TARGET_OBJECTS:...>` expression.  This matches the main
    ``id`` member of that other target.

  ``backtrace``
    Optional member that is present when a CMake language backtrace to
    the command invocation that created this dependency is available.
    The value is an unsigned integer 0-based index into the
    ``backtraceGraph`` member's ``nodes`` array.

  This field was added in codemodel version 2.9.

``orderDependencies``
  Optional member that is present when the target has one or more direct order
  dependencies on other targets.  Such dependencies may arise from calls to
  :command:`add_dependencies` or from internal CMake processing.
  Unlike the ``dependencies`` array, the ``ZERO_CHECK`` target will not be
  included in ``orderDependencies`` (this is only relevant for
  :generator:`Xcode` and :ref:`Visual Studio <Visual Studio Generators>`
  generators).

  The value is a JSON array of entries.  Each entry is a JSON object with
  members:

  ``id``
    A string uniquely identifying the target on which this target depends.
    This matches the main ``id`` member of the other target.

  ``backtrace``
    Optional member that is present when a CMake language backtrace to
    the command invocation that created this dependency is available.
    The value is an unsigned integer 0-based index into the
    ``backtraceGraph`` member's ``nodes`` array.

  This field was added in codemodel version 2.9.

``fileSets``
  An optional member that is present when a target defines one or more
  file sets.  The value is a JSON array of entries corresponding to the
  target's file sets.  Each entry is a JSON object with members:

  ``name``
    A string specifying the name of the file set.

  ``type``
    A string specifying the type of the file set.  See
    :command:`target_sources` supported file set types.

  ``visibility``
    A string specifying the visibility of the file set; one of ``PUBLIC``,
    ``PRIVATE``, or ``INTERFACE``.

  ``baseDirectories``
    A JSON array of strings, each specifying a base directory containing
    sources in the file set.  If the directory is inside the top-level source
    directory then the path is specified relative to that directory.
    Otherwise the path is absolute.

  This field was added in codemodel version 2.5.

``sources``
  A JSON array of entries corresponding to the target's source files.
  Each entry is a JSON object with members:

  ``path``
    A string specifying the path to the source file on disk, represented
    with forward slashes.  If the file is inside the top-level source
    directory then the path is specified relative to that directory.
    Otherwise the path is absolute.

  ``compileGroupIndex``
    Optional member that is present when the source is compiled.
    The value is an unsigned integer 0-based index into the
    ``compileGroups`` array.

  ``sourceGroupIndex``
    Optional member that is present when the source is part of a source
    group either via the :command:`source_group` command or by default.
    The value is an unsigned integer 0-based index into the
    ``sourceGroups`` array.

  ``isGenerated``
    Optional member that is present with boolean value ``true`` if
    the source is :prop_sf:`GENERATED`.

  ``fileSetIndex``
    Optional member that is present when the source is part of a file set.
    The value is an unsigned integer 0-based index into the ``fileSets``
    array.

    This field was added in codemodel version 2.5.

  ``backtrace``
    Optional member that is present when a CMake language backtrace to
    the :command:`target_sources`, :command:`add_executable`,
    :command:`add_library`, :command:`add_custom_target`, or other
    command invocation that added this source to the target is
    available.  The value is an unsigned integer 0-based index into
    the ``backtraceGraph`` member's ``nodes`` array.

``sourceGroups``
  Optional member that is present when sources are grouped together by
  the :command:`source_group` command or by default.  The value is a
  JSON array of entries corresponding to the groups.  Each entry is
  a JSON object with members:

  ``name``
    A string specifying the name of the source group.

  ``sourceIndexes``
    A JSON array listing the sources belonging to the group.
    Each entry is an unsigned integer 0-based index into the
    main ``sources`` array for the target.

``compileGroups``
  Optional member that is present when the target has sources that compile.
  The value is a JSON array of entries corresponding to groups of sources
  that all compile with the same settings.  Each entry is a JSON object
  with members:

  ``sourceIndexes``
    A JSON array listing the sources belonging to the group.
    Each entry is an unsigned integer 0-based index into the
    main ``sources`` array for the target.

  ``language``
    A string specifying the language (e.g. ``C``, ``CXX``, ``Fortran``)
    of the toolchain is used to compile the source file.

  ``languageStandard``
    Optional member that is present when the language standard is set
    explicitly (e.g. via :prop_tgt:`CXX_STANDARD`) or implicitly by
    compile features.  Each entry is a JSON object with two members:

    ``backtraces``
      Optional member that is present when a CMake language backtrace to
      the ``<LANG>_STANDARD`` setting is available.  If the language
      standard was set implicitly by compile features those are used as
      the backtrace(s).  It's possible for multiple compile features to
      require the same language standard so there could be multiple
      backtraces. The value is a JSON array with each entry being an
      unsigned integer 0-based index into the ``backtraceGraph``
      member's ``nodes`` array.

    ``standard``
      String representing the language standard.

    This field was added in codemodel version 2.2.

  ``compileCommandFragments``
    Optional member that is present when fragments of the compiler command
    line invocation are available.  The value is a JSON array of entries
    specifying ordered fragments.  Each entry is a JSON object with
    one member:

    ``fragment``
      A string specifying a fragment of the compile command line invocation.
      The value is encoded in the build system's native shell format.

    ``backtrace``
      Optional member that is present when a CMake language backtrace to
      the command invocation that added this fragment is available.
      The value is an unsigned integer 0-based index into the
      ``backtraceGraph`` member's ``nodes`` array.

  ``includes``
    Optional member that is present when there are include directories.
    The value is a JSON array with an entry for each directory.  Each
    entry is a JSON object with members:

    ``path``
      A string specifying the path to the include directory,
      represented with forward slashes.

    ``isSystem``
      Optional member that is present with boolean value ``true`` if
      the include directory is marked as a system include directory.

    ``backtrace``
      Optional member that is present when a CMake language backtrace to
      the :command:`target_include_directories` or other command invocation
      that added this include directory is available.  The value is
      an unsigned integer 0-based index into the ``backtraceGraph``
      member's ``nodes`` array.

  ``frameworks``
    Optional member that is present when, on Apple platforms, there are
    frameworks. The value is a JSON array with an entry for each directory.
    Each entry is a JSON object with members:

    ``path``
      A string specifying the path to the framework directory,
      represented with forward slashes.

    ``isSystem``
      Optional member that is present with boolean value ``true`` if
      the framework is marked as a system one.

    ``backtrace``
      Optional member that is present when a CMake language backtrace to
      the :command:`target_link_libraries` or other command invocation
      that added this framework is available.  The value is
      an unsigned integer 0-based index into the ``backtraceGraph``
      member's ``nodes`` array.

    This field was added in codemodel version 2.6.

  ``precompileHeaders``
    Optional member that is present when :command:`target_precompile_headers`
    or other command invocations set :prop_tgt:`PRECOMPILE_HEADERS` on the
    target.  The value is a JSON array with an entry for each header.  Each
    entry is a JSON object with members:

    ``header``
      Full path to the precompile header file.

    ``backtrace``
      Optional member that is present when a CMake language backtrace to
      the :command:`target_precompile_headers` or other command invocation
      that added this precompiled header is available.  The value is an
      unsigned integer 0-based index into the ``backtraceGraph`` member's
      ``nodes`` array.

    This field was added in codemodel version 2.1.

  ``defines``
    Optional member that is present when there are preprocessor definitions.
    The value is a JSON array with an entry for each definition.  Each
    entry is a JSON object with members:

    ``define``
      A string specifying the preprocessor definition in the format
      ``<name>[=<value>]``, e.g. ``DEF`` or ``DEF=1``.

    ``backtrace``
      Optional member that is present when a CMake language backtrace to
      the :command:`target_compile_definitions` or other command invocation
      that added this preprocessor definition is available.  The value is
      an unsigned integer 0-based index into the ``backtraceGraph``
      member's ``nodes`` array.

  ``sysroot``
    Optional member that is present when the
    :variable:`CMAKE_SYSROOT_COMPILE` or :variable:`CMAKE_SYSROOT`
    variable is defined.  The value is a JSON object with one member:

    ``path``
      A string specifying the absolute path to the sysroot, represented
      with forward slashes.

``backtraceGraph``
  A `"codemodel" version 2 "backtrace graph"`_ whose nodes are referenced
  from ``backtrace`` members elsewhere in this "target" object.

"codemodel" version 2 "backtrace graph"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The ``backtraceGraph`` member of a `"codemodel" version 2 "directory" object`_,
or `"codemodel" version 2 "target" object`_ is a JSON object describing a
graph of backtraces.  Its nodes are referenced from ``backtrace`` members
elsewhere in the containing object.  The backtrace graph object members are:

``nodes``
  A JSON array listing nodes in the backtrace graph.  Each entry
  is a JSON object with members:

  ``file``
    An unsigned integer 0-based index into the backtrace ``files`` array.

  ``line``
    An optional member present when the node represents a line within
    the file.  The value is an unsigned integer 1-based line number.

  ``command``
    An optional member present when the node represents a command
    invocation within the file.  The value is an unsigned integer
    0-based index into the backtrace ``commands`` array.

  ``parent``
    An optional member present when the node is not the bottom of
    the call stack.  The value is an unsigned integer 0-based index
    of another entry in the backtrace ``nodes`` array.

``commands``
  A JSON array listing command names referenced by backtrace nodes.
  Each entry is a string specifying a command name.

``files``
  A JSON array listing CMake language files referenced by backtrace nodes.
  Each entry is a string specifying the path to a file, represented
  with forward slashes.  If the file is inside the top-level source
  directory then the path is specified relative to that directory.
  Otherwise the path is absolute.

.. _`file-api configureLog`:

Object Kind "configureLog"
--------------------------

.. versionadded:: 3.26

The ``configureLog`` object kind describes the location and contents of
a :manual:`cmake-configure-log(7)` file.

There is only one ``configureLog`` object major version, version 1.

.. versionadded:: 4.1
  The ``configureLog`` object kind reply is described in machine-readable form
  by :download:`this JSON schema </manual/file_api/schema_configureLog.json>`.

"configureLog" version 1
^^^^^^^^^^^^^^^^^^^^^^^^

``configureLog`` object version 1 is a JSON object:

.. code-block:: json

  {
    "kind": "configureLog",
    "version": { "major": 1, "minor": 0 },
    "path": "/path/to/top-level-build-dir/CMakeFiles/CMakeConfigureLog.yaml",
    "eventKindNames": [ "try_compile-v1", "try_run-v1" ]
  }

The members specific to ``configureLog`` objects are:

``path``
  A string specifying the path to the configure log file.
  Clients must read the log file from this path, which may be
  different than the path documented by :manual:`cmake-configure-log(7)`.
  The log file may not exist if no events are logged.

``eventKindNames``
  A JSON array whose entries are each a JSON string naming one
  of the :manual:`cmake-configure-log(7)` versioned event kinds.
  At most one version of each configure log event kind will be listed.
  Although the configure log may contain other (versioned) event kinds,
  clients must ignore those that are not listed in this field.

Object Kind "cache"
-------------------

The ``cache`` object kind lists cache entries.  These are the
:ref:`CMake Language Variables` stored in the persistent cache
(``CMakeCache.txt``) for the build tree.

There is only one ``cache`` object major version, version 2.
Version 1 does not exist to avoid confusion with that from
:manual:`cmake-server(7)` mode.

.. versionadded:: 4.1
  The ``cache`` object kind reply is described in machine-readable form by
  :download:`this JSON schema </manual/file_api/schema_cache.json>`.

"cache" version 2
^^^^^^^^^^^^^^^^^

``cache`` object version 2 is a JSON object:

.. code-block:: json

  {
    "kind": "cache",
    "version": { "major": 2, "minor": 0 },
    "entries": [
      {
        "name": "BUILD_SHARED_LIBS",
        "value": "ON",
        "type": "BOOL",
        "properties": [
          {
            "name": "HELPSTRING",
            "value": "Build shared libraries"
          }
        ]
      },
      {
        "name": "CMAKE_GENERATOR",
        "value": "Unix Makefiles",
        "type": "INTERNAL",
        "properties": [
          {
            "name": "HELPSTRING",
            "value": "Name of generator."
          }
        ]
      }
    ]
  }

The members specific to ``cache`` objects are:

``entries``
  A JSON array whose entries are each a JSON object specifying a
  cache entry.  The members of each entry are:

  ``name``
    A string specifying the name of the entry.

  ``value``
    A string specifying the value of the entry.

  ``type``
    A string specifying the type of the entry used by
    :manual:`cmake-gui(1)` to choose a widget for editing.

  ``properties``
    A JSON array of entries specifying associated
    :ref:`cache entry properties <Cache Entry Properties>`.
    Each entry is a JSON object containing members:

    ``name``
      A string specifying the name of the cache entry property.

    ``value``
      A string specifying the value of the cache entry property.

Object Kind "cmakeFiles"
------------------------

The ``cmakeFiles`` object kind lists files used by CMake while
configuring and generating the build system.  These include the
``CMakeLists.txt`` files as well as included ``.cmake`` files.

There is only one ``cmakeFiles`` object major version, version 1.

.. versionadded:: 4.1
  The ``cmakeFiles`` object kind reply is described in machine-readable form
  by :download:`this JSON schema </manual/file_api/schema_cmakeFiles.json>`.

"cmakeFiles" version 1
^^^^^^^^^^^^^^^^^^^^^^

``cmakeFiles`` object version 1 is a JSON object:

.. code-block:: json

  {
    "kind": "cmakeFiles",
    "version": { "major": 1, "minor": 1 },
    "paths": {
      "build": "/path/to/top-level-build-dir",
      "source": "/path/to/top-level-source-dir"
    },
    "inputs": [
      {
        "path": "CMakeLists.txt"
      },
      {
        "isGenerated": true,
        "path": "/path/to/top-level-build-dir/.../CMakeSystem.cmake"
      },
      {
        "isExternal": true,
        "path": "/path/to/external/third-party/module.cmake"
      },
      {
        "isCMake": true,
        "isExternal": true,
        "path": "/path/to/cmake/Modules/CMakeGenericSystem.cmake"
      }
    ],
    "globsDependent": [
      {
        "expression": "src/*.cxx",
        "recurse": true,
        "files": [
          "src/foo.cxx",
          "src/bar.cxx"
        ]
      }
    ]
  }

The members specific to ``cmakeFiles`` objects are:

``paths``
  A JSON object containing members:

  ``source``
    A string specifying the absolute path to the top-level source directory,
    represented with forward slashes.

  ``build``
    A string specifying the absolute path to the top-level build directory,
    represented with forward slashes.

``inputs``
  A JSON array whose entries are each a JSON object specifying an input
  file used by CMake when configuring and generating the build system.
  The members of each entry are:

  ``path``
    A string specifying the path to an input file to CMake, represented
    with forward slashes.  If the file is inside the top-level source
    directory then the path is specified relative to that directory.
    Otherwise the path is absolute.

  ``isGenerated``
    Optional member that is present with boolean value ``true``
    if the path specifies a file that is under the top-level
    build directory and the build is out-of-source.
    This member is not available on in-source builds.

  ``isExternal``
    Optional member that is present with boolean value ``true``
    if the path specifies a file that is not under the top-level
    source or build directories.

  ``isCMake``
    Optional member that is present with boolean value ``true``
    if the path specifies a file in the CMake installation.

``globsDependent``
  Optional member that is present when the project calls :command:`file(GLOB)`
  or :command:`file(GLOB_RECURSE)` with the ``CONFIGURE_DEPENDS`` option.
  The value is a JSON array of JSON objects, each specifying a globbing
  expression and the list of paths it matched.  If the globbing expression
  no longer matches the same list of paths, CMake considers the build system
  to be out of date.

  This field was added in ``cmakeFiles`` version 1.1.

  The members of each entry are:

  ``expression``
    A string specifying the globbing expression.

  ``recurse``
    Optional member that is present with boolean value ``true``
    if the entry corresponds to a :command:`file(GLOB_RECURSE)` call.
    Otherwise the entry corresponds to a :command:`file(GLOB)` call.

  ``listDirectories``
    Optional member that is present with boolean value ``true`` if
    :command:`file(GLOB)` was called without ``LIST_DIRECTORIES false`` or
    :command:`file(GLOB_RECURSE)` was called with ``LIST_DIRECTORIES true``.

  ``followSymlinks``
    Optional member that is present with boolean value ``true`` if
    :command:`file(GLOB)` was called with the ``FOLLOW_SYMLINKS`` option.

  ``relative``
    Optional member that is present if :command:`file(GLOB)` was called
    with the ``RELATIVE <path>`` option.  The value is a string containing
    the ``<path>`` given.

  ``paths``
    A JSON array of strings specifying the paths matched by the call
    to :command:`file(GLOB)` or :command:`file(GLOB_RECURSE)`.

Object Kind "toolchains"
------------------------

The ``toolchains`` object kind lists properties of the toolchains used during
the build.  These include the language, compiler path, ID, and version.

There is only one ``toolchains`` object major version, version 1.

.. versionadded:: 4.1
  The ``toolchains`` object kind reply is described in machine-readable form
  by :download:`this JSON schema </manual/file_api/schema_toolchains.json>`.

"toolchains" version 1
^^^^^^^^^^^^^^^^^^^^^^

``toolchains`` object version 1 is a JSON object:

.. code-block:: json

  {
    "kind": "toolchains",
    "version": { "major": 1, "minor": 0 },
    "toolchains": [
      {
        "language": "C",
        "compiler": {
          "path": "/usr/bin/cc",
          "id": "GNU",
          "version": "9.3.0",
          "implicit": {
            "includeDirectories": [
              "/usr/lib/gcc/x86_64-linux-gnu/9/include",
              "/usr/local/include",
              "/usr/include/x86_64-linux-gnu",
              "/usr/include"
            ],
            "linkDirectories": [
              "/usr/lib/gcc/x86_64-linux-gnu/9",
              "/usr/lib/x86_64-linux-gnu",
              "/usr/lib",
              "/lib/x86_64-linux-gnu",
              "/lib"
            ],
            "linkFrameworkDirectories": [],
            "linkLibraries": [ "gcc", "gcc_s", "c", "gcc", "gcc_s" ]
          }
        },
        "sourceFileExtensions": [ "c", "m" ]
      },
      {
        "language": "CXX",
        "compiler": {
          "path": "/usr/bin/c++",
          "id": "GNU",
          "version": "9.3.0",
          "implicit": {
            "includeDirectories": [
              "/usr/include/c++/9",
              "/usr/include/x86_64-linux-gnu/c++/9",
              "/usr/include/c++/9/backward",
              "/usr/lib/gcc/x86_64-linux-gnu/9/include",
              "/usr/local/include",
              "/usr/include/x86_64-linux-gnu",
              "/usr/include"
            ],
            "linkDirectories": [
              "/usr/lib/gcc/x86_64-linux-gnu/9",
              "/usr/lib/x86_64-linux-gnu",
              "/usr/lib",
              "/lib/x86_64-linux-gnu",
              "/lib"
            ],
            "linkFrameworkDirectories": [],
            "linkLibraries": [
              "stdc++", "m", "gcc_s", "gcc", "c", "gcc_s", "gcc"
            ]
          }
        },
        "sourceFileExtensions": [
          "C", "M", "c++", "cc", "cpp", "cxx", "mm", "CPP"
        ]
      }
    ]
  }

The members specific to ``toolchains`` objects are:

``toolchains``
  A JSON array whose entries are each a JSON object specifying a toolchain
  associated with a particular language. The members of each entry are:

  ``language``
    A JSON string specifying the toolchain language, like C or CXX. Language
    names are the same as language names that can be passed to the
    :command:`project` command. Because CMake only supports a single toolchain
    per language, this field can be used as a key.

  ``compiler``
    A JSON object containing members:

    ``path``
      Optional member that is present when the
      :variable:`CMAKE_<LANG>_COMPILER` variable is defined for the current
      language. Its value is a JSON string holding the path to the compiler.

    ``id``
      Optional member that is present when the
      :variable:`CMAKE_<LANG>_COMPILER_ID` variable is defined for the current
      language. Its value is a JSON string holding the ID (GNU, MSVC, etc.) of
      the compiler.

    ``version``
      Optional member that is present when the
      :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable is defined for the
      current language. Its value is a JSON string holding the version of the
      compiler.

    ``target``
      Optional member that is present when the
      :variable:`CMAKE_<LANG>_COMPILER_TARGET` variable is defined for the
      current language. Its value is a JSON string holding the cross-compiling
      target of the compiler.

    ``implicit``
      A JSON object containing members:

      ``includeDirectories``
        Optional member that is present when the
        :variable:`CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` variable is
        defined for the current language. Its value is a JSON array of JSON
        strings where each string holds a path to an implicit include
        directory for the compiler.

      ``linkDirectories``
        Optional member that is present when the
        :variable:`CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES` variable is
        defined for the current language. Its value is a JSON array of JSON
        strings where each string holds a path to an implicit link directory
        for the compiler.

      ``linkFrameworkDirectories``
        Optional member that is present when the
        :variable:`CMAKE_<LANG>_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES` variable
        is defined for the current language. Its value is a JSON array of JSON
        strings where each string holds a path to an implicit link framework
        directory for the compiler.

      ``linkLibraries``
        Optional member that is present when the
        :variable:`CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES` variable is defined
        for the current language. Its value is a JSON array of JSON strings
        where each string holds a path to an implicit link library for the
        compiler.

  ``sourceFileExtensions``
    Optional member that is present when the
    :variable:`CMAKE_<LANG>_SOURCE_FILE_EXTENSIONS` variable is defined for
    the current language. Its value is a JSON array of JSON strings where
    each string holds a file extension (without the leading dot) for the
    language.