Find Modules

FindClangFormat

Module Source on GitHub

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)

Findliburing

Module Source on GitHub

A CMake find module used to find the installed liburing Linux library. This module provides access to the liburing library via CMake targets and variables. This module does not take the target system (CMAKE_SYSTEM_NAME link) into account. To avoid searching for liburing on non-Linux machines, explicitly wrap the find_packge(liburing) call in a condition.

Cache Variables

None

Result Variables

liburing_VERSION

The found liburing library version in the form <major>.<minor>

liburing_VERSION_MAJOR

The found liburing library major version as a single integer

liburing_VERSION_MINOR

The found liburing library minor version as a single integer

Imported Targets

liburing::liburing

The liburing library and usage requirements bundled as a CMake target. Has the INTERFACE_INCLUDE_DIRECTORIES and IMPORTED_LOCATION properties set.

Examples

find_package(liburing REQUIRED)

target_link_libraries(mylib PRIVATE liburing::liburing)
find_package(liburing 2.1...2.11 REQUIRED)

FindSphinx

Module Source on GitHub

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)