Find Modules¶
FindSphinx¶
A CMake find module used to find the Sphinx documentation generator. Sphinx provides an executable to build documentation, commonly called sphinx-build. This module provides access to it, or similarly named executables, via CMake targets and variables.
Cache Variables¶
Sphinx_EXECUTABLE
Path to found sphinx build executable
Result Variables¶
Sphinx_FOUND
True if the sphinx build executable was found
Sphinx_VERSION
The found sphinx version, where version is in the form <major>.<minor>.<patch>
Sphinx_VERSION_MAJOR
The found sphinx major version
Sphinx_VERSION_MINOR
The found sphinx minor version
Sphinx_VERSION_PATCH
The found sphinx patch version
Imported Targets¶
- Sphinx::build
The sphinx build executable (sphinx-build, sphinx-build2, sphinx-build3)
Examples¶
find_package(Sphinx REQUIRED)
FindClangFormat¶
A CMake find module used to find the
ClangFormat code formatter. This module provides
access to the clang-format executable via CMake targets and variables. When a version is provided
to find_package()
, this find-module will also consider version-suffixed clang-format
executables. See Examples below.
Clang offers a config-file package, which can be used to locate ClangFormat from CMake. However, this requires having the dev packages of LLVM & Clang installed. Additionally, LLVM often isn’t a dependency of Clang(Format) packages, which are frequently distributed independently.
Cache Variables¶
ClangFormat_EXECUTABLE
Path to found clang-foramt executable
Result Variables¶
ClangFormat_FOUND
True if the clang-format executable was found
ClangFormat_VERSION
The found version, where version is in the form <major>.<minor>.<patch>
ClangFormat_VERSION_MAJOR
The found major version
ClangFormat_VERSION_MINOR
The found minor version
ClangFormat_VERSION_PATCH
The found patch version
Imported Targets¶
- clang::format
The clang-format executable, as an imported CMake target
Examples¶
find_package(ClangFormat)
# considers executables "clang-format-14.0" and "clang-format-14" before "clang-format"
find_package(ClangFormat 14.0 REQUIRED)