Skip to content
ocx
install

ocx_bootstrap

Downloads a pinned ocx CLI release for the host and sets OCX_EXECUTABLE.

ocx_bootstrap([VERSION <version>] [TRIPLE <target-triple>]
[DIST_MANIFEST <dist.json>])

The call does nothing when OCX_EXECUTABLE already points at a binary of the requested version. The release row (URL and sha256) comes from the dist.json snapshot embedded in ocx.cmake. OCX_INSTALL_DIST_URL fetches a mirrored manifest instead, and DIST_MANIFEST names a local file that wins over both. OCX_INSTALL_MIRROR_URL rewrites the artifact download to <mirror>/<tag>/<filename>.

The module verifies the archive against the sha256 of its manifest row before extraction, whichever manifest or URL served it. The extracted binary must report the requested version, else it is removed and the configure fails.

Binaries land in the per-machine OCX_BOOTSTRAP_CACHE. They are downloaded once per machine and shared by all build trees. A warm cache needs no network access, so an air-gapped reconfigure stays offline.

Changed in version 0.4. Downloads verify TLS and are bounded by a timeout. The module probes the version of a fresh binary.

An empty argument value is an error, because it usually means that a variable is unset.

VERSION <version>

ocx CLI version to download. The default is OCX_INSTALL_VERSION, else the version pinned by this find_ocx release.

TRIPLE <target-triple>

Release target triple. The default is the host triple. The module does not probe the version of a foreign triple, because its binary cannot run here.

DIST_MANIFEST <dist.json>

Local release manifest that wins over the embedded snapshot and over OCX_INSTALL_DIST_URL. A relative path resolves against the directory of the calling file. A project configure watches the file, so editing it reconfigures. Script mode reads it once.

New in version 0.4.

OCX_EXECUTABLE

Cache variable that holds the path of the bootstrapped binary.

The fixture tests/fixtures/bootstrap/CMakeLists.txt runs these calls.

include(ocx)
ocx_bootstrap()
find_package(ocx REQUIRED)

All commands are listed in the command reference.