The set of package files distributed on cmake.org
varies by CMake version.
One file, named cmake-<ver>-files-v1.json
, contains a table of the package
files available for a given version. Clients may use this to find other files.
The format is a JSON object:
{
"version": {
"major": 3, "minor": 20, "patch": 0,
"string": "3.20.0"
},
"files": [
{
"os": ["...", "..."],
"architecture": ["...", "..."],
"class": "...",
"name": "..."
}
],
"hashFiles": [
{
"algorithm": ["...", "..."],
"name": "cmake-<version>-<algo>.txt",
"signature": ["cmake-<version>-<algo>.txt.asc"]
}
]
}
The members are:
version
A JSON object specifying the version of CMake with members:
major
, minor
, patch
suffix
rc1
.string
<major>.<minor>.<patch>[-<suffix>]
.files
A JSON array of entries corresponding to available package files. Each entry is a JSON object containing members:
os
A JSON array of strings naming the operating system for which the package file is built, possibly using multiple alternative spellings. Possible names include:
source
Linux
, linux
macOS
, macos
Windows
, windows
architecture
[]
).
Binary packages have a non-empty list of architectures, with at least
one name matching the output of uname -m
on corresponding hosts.
On Windows, architecture names include x86_64
, i386
, and arm64
.
On macOS, universal binary packages list all architectures,
e.g. ["arm64","x86_64"]
.class
A JSON string naming the class of package. The value is one of:
archive
.tar.gz
or .zip
, indicates the format.
The rest of the file name matches the top-level directory in the archive.installer
volume
.dmg
on macOS).name
macOSmin
"10.13"
.deprecated
hashFiles
A JSON array of entries corresponding to files containing cryptographic hashes of the package file contents. Each entry is a JSON object containing members:
algorithm
["sha256", "SHA-256"]
.name
"cmake-<version>-SHA-256.txt"
.signature
name
, e.g.
["cmake-<version>-SHA-256.txt.asc"]
.deprecated
deprecated
The table and hash files are generated by files.bash from the files-v1.json.in template and the package files themselves.
Clients may download the File Table v1 file cmake-<ver>-files-v1.json
and query it to get the name(s) of specific package files adjacent to it.
Make queries as specific as possible in order to account for additional
alternative binaries in future CMake versions.
For example, one may use jq
queries:
To select a Windows binary archive supporting x86_64
hosts:
.files[] | select((.os[] | . == "windows") and (.architecture[] | . == "x86_64") and (.class == "archive")) | .name
To select a Linux binary archive supporting aarch64
hosts:
.files[] | select((.os[] | . == "linux") and (.architecture[] | . == "aarch64") and (.class == "archive")) | .name
To select a macOS binary archive supporting arm64
hosts:
.files[] | select((.os[] | . == "macos") and (.architecture[] | . == "arm64") and (.class == "archive")) | .name
To select a macOS binary archive supporting macOS 10.12 on x86_64
hosts:
.files[] | select((.os[] | contains("macOS")) and (.architecture[] | . == "x86_64") and ([.macOSmin] | inside(["10.10", "10.11", "10.12"])) ) | .name
To select a SHA-256 hash file:
.hashFiles[] | select(.algorithm[] | . == "SHA-256") | .name
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。