- integrations
- Get started
- find_ocx
find_ocx
find_ocx runs pinned, sha256-verified tools such as jq or shellcheck from your CMake build without installing them, using the OCX package manager.
cmake_minimum_required(VERSION 3.25...4.4)project(hello_jq LANGUAGES NONE)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")include(ocx)
ocx_project(NAME TOOLS BINS jq)
add_custom_target(show_jq ALL COMMAND ${OCX_TOOLS_RUN} jq --version VERBATIM)Why not install the tool first
Section titled “Why not install the tool first”A build that needs jq usually says “install jq first” in its README.
Or it calls find_program and takes whatever the host has.
Every machine then runs its own version.
FetchContent and CPM fetch sources to compile.
The vcpkg and Conan clients must be installed and configured before the build starts.
With find_ocx, a prebuilt tool runs at the digest your ocx.lock fixes, on every machine.
Run jq in a CMake build is the shortest path to a first result.
Pick a goal
Section titled “Pick a goal”This documentation is for CMake authors and the platform engineers who run their builds.
- Everyday guides: add a tool, freeze a tag, find provisioned content, update the vendored files
- Reproduce the build in CI: the same tool versions on Linux, macOS and Windows
- Build behind a mirror or offline: internal hosts and no downloads
- Route package pulls through a mirror: registry hosts, the corporate CA and credentials
- Fix a failing configure: the error text, its cause and the fix