Skip to content
ocx
install

Findocx.cmake

Reference for the Findocx find module. This page is generated from the .rst block in Findocx.cmake.

Finds the OCX CLI:

find_package(ocx [<version>] [REQUIRED])

Result variables and targets:

ocx_FOUND / OCX_FOUND

True when the ocx CLI was found (and satisfies the requested version).

OCX_EXECUTABLE

Path to the ocx CLI (cache; also the search hint).

OCX_VERSION_STRING

Version reported by ocx version.

ocx::ocx

Imported executable target.

Hints: set OCX_EXECUTABLE (e.g. via ocx_bootstrap from the sibling ocx.cmake) to use a specific binary. With OCX_BOOTSTRAP=ON this module bootstraps the pinned ocx itself when none is found, and with OCX_BOOTSTRAP=ALWAYS it skips the PATH search and always uses the pin (both require CMake 3.19 and ocx.cmake next to this file):

find_package(ocx REQUIRED) # -DOCX_BOOTSTRAP=ON => zero-setup corporate UX

Both entry points resolve OCX_EXECUTABLE, then PATH, then the pinned bootstrap — they differ only in the bootstrap default: opt-in here (find modules discover), opt-out in ocx.cmake (OFF forbids the implicit download there).

This find module works standalone on CMake 3.15+. The provisioning commands (ocx_project, ocx_package) live in ocx.cmake — include(ocx).