code:
/*
 * basic.css
 * ~~~~~~~~~
 *
 * Sphinx stylesheet -- basic theme.
 *
 * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
 * :license: BSD, see LICENSE for details.
 *
 */

/* -- main layout ----------------------------------------------------------- */

div.clearer {
    clear: both;
}

div.section::after {
    display: block;
    content: '';
    clear: left;
}

/* -- relbar ---------------------------------------------------------------- */

div.related {
    width: 100%;
    font-size: 90%;
}

div.related h3 {
    display: none;
}

div.related ul {
    margin: 0;
    padding: 0 0 0 10px;
    list-style: none;
}

div.related li {
    display: inline;
}

div.related li.right {
    float: right;
    margin-right: 5px;
}

/* -- sidebar --------------------------------------------------------------- */

div.sphinxsidebarwrapper {
    padding: 10px 5px 0 10px;
}

div.sphinxsidebar {
    float: left;
    width: 230px;
    margin-left: -100%;
    font-size: 90%;
    word-wrap: break-word;
    overflow-wrap : break-word;
}

div.sphinxsidebar ul {
    list-style: none;
}

div.sphinxsidebar ul ul,
div.sphinxsidebar ul.want-points {
    margin-left: 20px;
    list-style: square;
}

div.sphinxsidebar ul ul {
    margin-top: 0;
    margin-bottom: 0;
}

div.sphinxsidebar form {
    margin-top: 10px;
}

div.sphinxsidebar input {
    border: 1px solid #98dbcc;
    font-family: sans-serif;
    font-size: 1em;
}

div.sphinxsidebar #searchbox form.search {
    overflow: hidden;
}

div.sphinxsidebar #searchbox input[type="text"] {
    float: left;
    width: 80%;
    padding: 0.25em;
    box-sizing: border-box;
}

div.sphinxsidebar #searchbox input[type="submit"] {
    float: left;
    width: 20%;
    border-left: none;
    padding: 0.25em;
    box-sizing: border-box;
}

img {
    border: 0;
    max-width: 100%;
}

/* -- search page ----------------------------------------------------------- */

ul.search {
    margin: 10px 0 0 20px;
    padding: 0;
}

ul.search li {
    padding: 5px 0 5px 20px;
    background-image: url(file.png);
    background-repeat: no-repeat;
    background-position: 0 7px;
}

ul.search li a {
    font-weight: bold;
}

ul.search li p.context {
    color: #888;
    margin: 2px 0 0 30px;
    text-align: left;
}

ul.keywordmatches li.goodmatch a {
    font-weight: bold;
}

/* -- index page ------------------------------------------------------------ */

table.contentstable {
    width: 90%;
    margin-left: auto;
    margin-right: auto;
}

table.contentstable p.biglink {
    line-height: 150%;
}

a.biglink {
    font-size: 1.3em;
}

span.linkdescr {
    font-style: italic;
    padding-top: 5px;
    font-size: 90%;
}

/* -- general index --------------------------------------------------------- */

table.indextable {
    width: 100%;
}

table.indextable td {
    text-align: left;
    vertical-align: top;
}

table.indextable ul {
    margin-top: 0;
    margin-bottom: 0;
    list-style-type: none;
}

table.indextable > tbody > tr > td > ul {
    padding-left: 0em;
}

table.indextable tr.pcap {
    height: 10px;
}

table.indextable tr.cap {
    margin-top: 10px;
    background-color: #f2f2f2;
}

img.toggler {
    margin-right: 3px;
    margin-top: 3px;
    cursor: pointer;
}

div.modindex-jumpbox {
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    margin: 1em 0 1em 0;
    padding: 0.4em;
}

div.genindex-jumpbox {
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    margin: 1em 0 1em 0;
    padding: 0.4em;
}

/* -- domain module index --------------------------------------------------- */

table.modindextable td {
    padding: 2px;
    border-collapse: collapse;
}

/* -- general body styles --------------------------------------------------- */

div.body {
    min-width: 360px;
    max-width: 800px;
}

div.body p, div.body dd, div.body li, div.body blockquote {
    -moz-hyphens: auto;
    -ms-hyphens: auto;
    -webkit-hyphens: auto;
    hyphens: auto;
}

a.headerlink {
    visibility: hidden;
}

h1:hover > a.headerlink,
h2:hover > a.headerlink,
h3:hover > a.headerlink,
h4:hover > a.headerlink,
h5:hover > a.headerlink,
h6:hover > a.headerlink,
dt:hover > a.headerlink,
caption:hover > a.headerlink,
p.caption:hover > a.headerlink,
div.code-block-caption:hover > a.headerlink {
    visibility: visible;
}

div.body p.caption {
    text-align: inherit;
}

div.body td {
    text-align: left;
}

.first {
    margin-top: 0 !important;
}

p.rubric {
    margin-top: 30px;
    font-weight: bold;
}

img.align-left, figure.align-left, .figure.align-left, object.align-left {
    clear: left;
    float: left;
    margin-right: 1em;
}

img.align-right, figure.align-right, .figure.align-right, object.align-right {
    clear: right;
    float: right;
    margin-left: 1em;
}

img.align-center, figure.align-center, .figure.align-center, object.align-center {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

img.align-default, figure.align-default, .figure.align-default {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.align-left {
    text-align: left;
}

.align-center {
    text-align: center;
}

.align-default {
    text-align: center;
}

.align-right {
    text-align: right;
}

/* -- sidebars -------------------------------------------------------------- */

div.sidebar,
aside.sidebar {
    margin: 0 0 0.5em 1em;
    border: 1px solid #ddb;
    padding: 7px;
    background-color: #ffe;
    width: 40%;
    float: right;
    clear: right;
    overflow-x: auto;
}

p.sidebar-title {
    font-weight: bold;
}

nav.contents,
aside.topic,
div.admonition, div.topic, blockquote {
    clear: left;
}

/* -- topics ---------------------------------------------------------------- */

nav.contents,
aside.topic,
div.topic {
    border: 1px solid #ccc;
    padding: 7px;
    margin: 10px 0 10px 0;
}

p.topic-title {
    font-size: 1.1em;
    font-weight: bold;
    margin-top: 10px;
}

/* -- admonitions ----------------------------------------------------------- */

div.admonition {
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 7px;
}

div.admonition dt {
    font-weight: bold;
}

p.admonition-title {
    margin: 0px 10px 5px 0px;
    font-weight: bold;
}

div.body p.centered {
    text-align: center;
    margin-top: 25px;
}

/* -- content of sidebars/topics/admonitions -------------------------------- */

div.sidebar > :last-child,
aside.sidebar > :last-child,
nav.contents > :last-child,
aside.topic > :last-child,
div.topic > :last-child,
div.admonition > :last-child {
    margin-bottom: 0;
}

div.sidebar::after,
aside.sidebar::after,
nav.contents::after,
aside.topic::after,
div.topic::after,
div.admonition::after,
blockquote::after {
    display: block;
    content: '';
    clear: both;
}

/* -- tables ---------------------------------------------------------------- */

table.docutils {
    margin-top: 10px;
    margin-bottom: 10px;
    border: 0;
    border-collapse: collapse;
}

table.align-center {
    margin-left: auto;
    margin-right: auto;
}

table.align-default {
    margin-left: auto;
    margin-right: auto;
}

table caption span.caption-number {
    font-style: italic;
}

table caption span.caption-text {
}

table.docutils td, table.docutils th {
    padding: 1px 8px 1px 5px;
    border-top: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 1px solid #aaa;
}

th {
    text-align: left;
    padding-right: 5px;
}

table.citation {
    border-left: solid 1px gray;
    margin-left: 1px;
}

table.citation td {
    border-bottom: none;
}

th > :first-child,
td > :first-child {
    margin-top: 0px;
}

th > :last-child,
td > :last-child {
    margin-bottom: 0px;
}

/* -- figures --------------------------------------------------------------- */

div.figure, figure {
    margin: 0.5em;
    padding: 0.5em;
}

div.figure p.caption, figcaption {
    padding: 0.3em;
}

div.figure p.caption span.caption-number,
figcaption span.caption-number {
    font-style: italic;
}

div.figure p.caption span.caption-text,
figcaption span.caption-text {
}

/* -- field list styles ----------------------------------------------------- */

table.field-list td, table.field-list th {
    border: 0 !important;
}

.field-list ul {
    margin: 0;
    padding-left: 1em;
}

.field-list p {
    margin: 0;
}

.field-name {
    -moz-hyphens: manual;
    -ms-hyphens: manual;
    -webkit-hyphens: manual;
    hyphens: manual;
}

/* -- hlist styles ---------------------------------------------------------- */

table.hlist {
    margin: 1em 0;
}

table.hlist td {
    vertical-align: top;
}

/* -- object description styles --------------------------------------------- */

.sig {
	font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
}

.sig-name, code.descname {
    background-color: transparent;
    font-weight: bold;
}

.sig-name {
	font-size: 1.1em;
}

code.descname {
    font-size: 1.2em;
}

.sig-prename, code.descclassname {
    background-color: transparent;
}

.optional {
    font-size: 1.3em;
}

.sig-paren {
    font-size: larger;
}

.sig-param.n {
	font-style: italic;
}

/* C++ specific styling */

.sig-inline.c-texpr,
.sig-inline.cpp-texpr {
	font-family: unset;
}

.sig.c   .k, .sig.c   .kt,
.sig.cpp .k, .sig.cpp .kt {
	color: #0033B3;
}

.sig.c   .m,
.sig.cpp .m {
	color: #1750EB;
}

.sig.c   .s, .sig.c   .sc,
.sig.cpp .s, .sig.cpp .sc {
	color: #067D17;
}

/* -- other body styles ----------------------------------------------------- */

ol.arabic {
    list-style: decimal;
}

ol.loweralpha {
    list-style: lower-alpha;
}

ol.upperalpha {
    list-style: upper-alpha;
}

ol.lowerroman {
    list-style: lower-roman;
}

ol.upperroman {
    list-style: upper-roman;
}

:not(li) > ol > li:first-child > :first-child,
:not(li) > ul > li:first-child > :first-child {
    margin-top: 0px;
}

:not(li) > ol > li:last-child > :last-child,
:not(li) > ul > li:last-child > :last-child {
    margin-bottom: 0px;
}

ol.simple ol p,
ol.simple ul p,
ul.simple ol p,
ul.simple ul p {
    margin-top: 0;
}

ol.simple > li:not(:first-child) > p,
ul.simple > li:not(:first-child) > p {
    margin-top: 0;
}

ol.simple p,
ul.simple p {
    margin-bottom: 0;
}

aside.footnote > span,
div.citation > span {
    float: left;
}
aside.footnote > span:last-of-type,
div.citation > span:last-of-type {
  padding-right: 0.5em;
}
aside.footnote > p {
  margin-left: 2em;
}
div.citation > p {
  margin-left: 4em;
}
aside.footnote > p:last-of-type,
div.citation > p:last-of-type {
    margin-bottom: 0em;
}
aside.footnote > p:last-of-type:after,
div.citation > p:last-of-type:after {
    content: "";
    clear: both;
}

dl.field-list {
    display: grid;
    grid-template-columns: fit-content(30%) auto;
}

dl.field-list > dt {
    font-weight: bold;
    word-break: break-word;
    padding-left: 0.5em;
    padding-right: 5px;
}

dl.field-list > dd {
    padding-left: 0.5em;
    margin-top: 0em;
    margin-left: 0em;
    margin-bottom: 0em;
}

dl {
    margin-bottom: 15px;
}

dd > :first-child {
    margin-top: 0px;
}

dd ul, dd table {
    margin-bottom: 10px;
}

dd {
    margin-top: 3px;
    margin-bottom: 10px;
    margin-left: 30px;
}

dl > dd:last-child,
dl > dd:last-child > :last-child {
    margin-bottom: 0;
}

dt:target, span.highlighted {
    background-color: #fbe54e;
}

rect.highlighted {
    fill: #fbe54e;
}

dl.glossary dt {
    font-weight: bold;
    font-size: 1.1em;
}

.versionmodified {
    font-style: italic;
}

.system-message {
    background-color: #fda;
    padding: 5px;
    border: 3px solid red;
}

.footnote:target  {
    background-color: #ffa;
}

.line-block {
    display: block;
    margin-top: 1em;
    margin-bottom: 1em;
}

.line-block .line-block {
    margin-top: 0;
    margin-bottom: 0;
    margin-left: 1.5em;
}

.guilabel, .menuselection {
    font-family: sans-serif;
}

.accelerator {
    text-decoration: underline;
}

.classifier {
    font-style: oblique;
}

.classifier:before {
    font-style: normal;
    margin: 0 0.5em;
    content: ":";
    display: inline-block;
}

abbr, acronym {
    border-bottom: dotted 1px;
    cursor: help;
}

/* -- code displays --------------------------------------------------------- */

pre {
    overflow: auto;
    overflow-y: hidden;  /* fixes display issues on Chrome browsers */
}

pre, div[class*="highlight-"] {
    clear: both;
}

span.pre {
    -moz-hyphens: none;
    -ms-hyphens: none;
    -webkit-hyphens: none;
    hyphens: none;
    white-space: nowrap;
}

div[class*="highlight-"] {
    margin: 1em 0;
}

td.linenos pre {
    border: 0;
    background-color: transparent;
    color: #aaa;
}

table.highlighttable {
    display: block;
}

table.highlighttable tbody {
    display: block;
}

table.highlighttable tr {
    display: flex;
}

table.highlighttable td {
    margin: 0;
    padding: 0;
}

table.highlighttable td.linenos {
    padding-right: 0.5em;
}

table.highlighttable td.code {
    flex: 1;
    overflow: hidden;
}

.highlight .hll {
    display: block;
}

div.highlight pre,
table.highlighttable pre {
    margin: 0;
}

div.code-block-caption + div {
    margin-top: 0;
}

div.code-block-caption {
    margin-top: 1em;
    padding: 2px 5px;
    font-size: small;
}

div.code-block-caption code {
    background-color: transparent;
}

table.highlighttable td.linenos,
span.linenos,
div.highlight span.gp {  /* gp: Generic.Prompt */
  user-select: none;
  -webkit-user-select: text; /* Safari fallback only */
  -webkit-user-select: none; /* Chrome/Safari */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* IE10+ */
}

div.code-block-caption span.caption-number {
    padding: 0.1em 0.3em;
    font-style: italic;
}

div.code-block-caption span.caption-text {
}

div.literal-block-wrapper {
    margin: 1em 0;
}

code.xref, a code {
    background-color: transparent;
    font-weight: bold;
}

h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
    background-color: transparent;
}

.viewcode-link {
    float: right;
}

.viewcode-back {
    float: right;
    font-family: sans-serif;
}

div.viewcode-block:target {
    margin: -1px -10px;
    padding: 0 10px;
}

/* -- math display ---------------------------------------------------------- */

img.math {
    vertical-align: middle;
}

div.body div.math p {
    text-align: center;
}

span.eqno {
    float: right;
}

span.eqno a.headerlink {
    position: absolute;
    z-index: 1;
}

div.math:hover a.headerlink {
    visibility: visible;
}

/* -- printout stylesheet --------------------------------------------------- */

@media print {
    div.document,
    div.documentwrapper,
    div.bodywrapper {
        margin: 0 !important;
        width: 100%;
    }

    div.sphinxsidebar,
    div.related,
    div.footer,
    #top-link {
        display: none;
    }
}


code:
/*
 * classic.css_t
 * ~~~~~~~~~~~~~
 *
 * Sphinx stylesheet -- classic theme.
 *
 * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
 * :license: BSD, see LICENSE for details.
 *
 */

@import url("basic.css");

/* -- page layout ----------------------------------------------------------- */

html {
    /* CSS hack for macOS's scrollbar (see #1125) */
    background-color: #FFFFFF;
}

body {
    font-family: sans-serif;
    font-size: 100%;
    background-color: #00182d;
    color: #000;
    margin: 0;
    padding: 0;
}

div.document {
    display: flex;
    background-color: #e4ece8;
}

div.documentwrapper {
    float: left;
    width: 100%;
}

div.bodywrapper {
    margin: 0 0 0 230px;
}

div.body {
    background-color: #ffffff;
    color: #444444;
    padding: 0 20px 30px 20px;
}

div.footer {
    color: #ffffff;
    width: 100%;
    padding: 9px 0 9px 0;
    text-align: center;
    font-size: 75%;
}

div.footer a {
    color: #ffffff;
    text-decoration: underline;
}

div.related {
    background-color: #00529b;
    line-height: 30px;
    color: #ffffff;
}

div.related a {
    color: #ffffff;
}

div.sphinxsidebar {
}

div.sphinxsidebar h3 {
    font-family: 'Trebuchet MS', sans-serif;
    color: #333333;
    font-size: 1.4em;
    font-weight: normal;
    margin: 0;
    padding: 0;
}

div.sphinxsidebar h3 a {
    color: #333333;
}

div.sphinxsidebar h4 {
    font-family: 'Trebuchet MS', sans-serif;
    color: #333333;
    font-size: 1.3em;
    font-weight: normal;
    margin: 5px 0 0 0;
    padding: 0;
}

div.sphinxsidebar p {
    color: #333333;
}

div.sphinxsidebar p.topless {
    margin: 5px 10px 10px 10px;
}

div.sphinxsidebar ul {
    margin: 10px;
    padding: 0;
    color: #333333;
}

div.sphinxsidebar a {
    color: #00a94f;
}

div.sphinxsidebar input {
    border: 1px solid #00a94f;
    font-family: sans-serif;
    font-size: 1em;
}

/* -- hyperlink styles ------------------------------------------------------ */

a {
    color: #2b63a8;
    text-decoration: none;
}

a:visited {
    color: #2b63a8;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* -- body styles ----------------------------------------------------------- */

div.body h1,
div.body h2,
div.body h3,
div.body h4,
div.body h5,
div.body h6 {
    font-family: 'Trebuchet MS', sans-serif;
    background-color: #f2f2f2;
    font-weight: normal;
    color: #003564;
    border-bottom: 1px solid #ccc;
    margin: 20px -20px 10px -20px;
    padding: 3px 0 3px 10px;
}

div.body h1 { margin-top: 0; font-size: 200%; }
div.body h2 { font-size: 160%; }
div.body h3 { font-size: 140%; }
div.body h4 { font-size: 120%; }
div.body h5 { font-size: 110%; }
div.body h6 { font-size: 100%; }

a.headerlink {
    color: #3d8ff2;
    font-size: 0.8em;
    padding: 0 4px 0 4px;
    text-decoration: none;
}

a.headerlink:hover {
    background-color: #3d8ff2;
    color: white;
}

div.body p, div.body dd, div.body li, div.body blockquote {
    text-align: justify;
    line-height: 130%;
}

div.admonition p.admonition-title + p {
    display: inline;
}

div.admonition p {
    margin-bottom: 5px;
}

div.admonition pre {
    margin-bottom: 5px;
}

div.admonition ul, div.admonition ol {
    margin-bottom: 5px;
}

div.note {
    background-color: #eee;
    border: 1px solid #ccc;
}

div.seealso {
    background-color: #ffc;
    border: 1px solid #ff6;
}

nav.contents,
aside.topic,
div.topic {
    background-color: #eee;
}

div.warning {
    background-color: #ffe4e4;
    border: 1px solid #f66;
}

p.admonition-title {
    display: inline;
}

p.admonition-title:after {
    content: ":";
}

pre {
    padding: 5px;
    background-color: #eeeeee;
    color: #333333;
    line-height: 120%;
    border: 1px solid #ac9;
    border-left: none;
    border-right: none;
}

code {
    background-color: #ecf0f3;
    padding: 0 1px 0 1px;
    font-size: 0.95em;
}

th, dl.field-list > dt {
    background-color: #ede;
}

.warning code {
    background: #efc2c2;
}

.note code {
    background: #d6d6d6;
}

.viewcode-back {
    font-family: sans-serif;
}

div.viewcode-block:target {
    background-color: #f4debf;
    border-top: 1px solid #ac9;
    border-bottom: 1px solid #ac9;
}

div.code-block-caption {
    color: #efefef;
    background-color: #1c4e63;
}

repo_name: lazytadpole/codenamesilverfish

license: mit


code:
/* Import the Sphinx theme style.  */
@import url("default.css");

/* Wrap sidebar content even within words so that long
   document names do not escape sidebar borders.  */
div.sphinxsidebarwrapper {
  word-wrap: break-word;
}

/* Make links inside parsed-literal blocks more obvious
   by using a background color and increased line spacing
   to make them look boxed.  */
.literal-block {
  line-height: 1.4;
}
.literal-block a.reference.internal {
  background-color: #dfdfdf;
}

/* Apply <pre> style (from classic.css) to signature directive argument. */
.signature .sig {
  padding: 5px;
  background-color: #eeeeee;
  color: #333333;
  line-height: 120%;
  border: 1px solid #ac9;
  border-left: none;
  border-right: none;
}

/* Add additional styling to signature directive argument. */
.signature .sig {
  margin-bottom: 5px;
  padding-left: calc(5px + 3em);
  text-indent: -3em;
  font-family: monospace;
}

.signature .sig .code.sig-name {
  font-weight: normal;
}

/* Implement non-breaking spaces in signatures. */
.nbsp {
  white-space: nowrap;
}

/* Add hanging indent to deprecated and version-{added,changed} content. */
div.deprecated > *,
div.versionadded > *,
div.versionchanged > * {
  padding-left: 2em;
}

div.deprecated > :first-child,
div.versionadded > :first-child,
div.versionchanged > :first-child {
  text-indent: -2em;
}

/* Remove unwanted margin in case list item contains a div-wrapping
   directive like `.. versionadded` or `.. deprecated`. */
dd > :first-child > p {
  margin-top: 0px;
}

div.outdated {
  background-color: #f0f0c0;
  color: black;
  font-size: 90%;
  padding-bottom: 5px;
  padding-left: 2px;
  padding-right: 2px;
  padding-top: 5px;
  text-align: center;
  width: 100%;
}

/* Revert style to the inherited (normal text) for `:guide:` links */
code.xref.cmake-guide {
  font-size: inherit;
  font-family: inherit;
  font-weight: inherit;
  padding: inherit;
}
code.xref.cmake-guide span.pre {
  white-space: inherit;
}


code: @import url("classic.css");


code:
/*
 * doctools.js
 * ~~~~~~~~~~~
 *
 * Base JavaScript utilities for all Sphinx HTML documentation.
 *
 * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
 * :license: BSD, see LICENSE for details.
 *
 */
"use strict";

const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([
  "TEXTAREA",
  "INPUT",
  "SELECT",
  "BUTTON",
]);

const _ready = (callback) => {
  if (document.readyState !== "loading") {
    callback();
  } else {
    document.addEventListener("DOMContentLoaded", callback);
  }
};

/**
 * Small JavaScript module for the documentation.
 */
const Documentation = {
  init: () => {
    Documentation.initDomainIndexTable();
    Documentation.initOnKeyListeners();
  },

  /**
   * i18n support
   */
  TRANSLATIONS: {},
  PLURAL_EXPR: (n) => (n === 1 ? 0 : 1),
  LOCALE: "unknown",

  // gettext and ngettext don't access this so that the functions
  // can safely bound to a different name (_ = Documentation.gettext)
  gettext: (string) => {
    const translated = Documentation.TRANSLATIONS[string];
    switch (typeof translated) {
      case "undefined":
        return string; // no translation
      case "string":
        return translated; // translation exists
      default:
        return translated[0]; // (singular, plural) translation tuple exists
    }
  },

  ngettext: (singular, plural, n) => {
    const translated = Documentation.TRANSLATIONS[singular];
    if (typeof translated !== "undefined")
      return translated[Documentation.PLURAL_EXPR(n)];
    return n === 1 ? singular : plural;
  },

  addTranslations: (catalog) => {
    Object.assign(Documentation.TRANSLATIONS, catalog.messages);
    Documentation.PLURAL_EXPR = new Function(
      "n",
      `return (${catalog.plural_expr})`
    );
    Documentation.LOCALE = catalog.locale;
  },

  /**
   * helper function to focus on search bar
   */
  focusSearchBar: () => {
    document.querySelectorAll("input[name=q]")[0]?.focus();
  },

  /**
   * Initialise the domain index toggle buttons
   */
  initDomainIndexTable: () => {
    const toggler = (el) => {
      const idNumber = el.id.substr(7);
      const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`);
      if (el.src.substr(-9) === "minus.png") {
        el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`;
        toggledRows.forEach((el) => (el.style.display = "none"));
      } else {
        el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`;
        toggledRows.forEach((el) => (el.style.display = ""));
      }
    };

    const togglerElements = document.querySelectorAll("img.toggler");
    togglerElements.forEach((el) =>
      el.addEventListener("click", (event) => toggler(event.currentTarget))
    );
    togglerElements.forEach((el) => (el.style.display = ""));
    if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler);
  },

  initOnKeyListeners: () => {
    // only install a listener if it is really needed
    if (
      !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS &&
      !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS
    )
      return;

    document.addEventListener("keydown", (event) => {
      // bail for input elements
      if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return;
      // bail with special keys
      if (event.altKey || event.ctrlKey || event.metaKey) return;

      if (!event.shiftKey) {
        switch (event.key) {
          case "ArrowLeft":
            if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break;

            const prevLink = document.querySelector('link[rel="prev"]');
            if (prevLink && prevLink.href) {
              window.location.href = prevLink.href;
              event.preventDefault();
            }
            break;
          case "ArrowRight":
            if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break;

            const nextLink = document.querySelector('link[rel="next"]');
            if (nextLink && nextLink.href) {
              window.location.href = nextLink.href;
              event.preventDefault();
            }
            break;
        }
      }

      // some keyboard layouts may need Shift to get /
      switch (event.key) {
        case "/":
          if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break;
          Documentation.focusSearchBar();
          event.preventDefault();
      }
    });
  },
};

// quick alias for translations
const _ = Documentation.gettext;

_ready(Documentation.init);


code:
var DOCUMENTATION_OPTIONS = {
    URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
    VERSION: '3.29.0-rc3',
    LANGUAGE: 'en',
    COLLAPSE_INDEX: false,
    BUILDER: 'html',
    FILE_SUFFIX: '.html',
    LINK_SUFFIX: '.html',
    HAS_SOURCE: true,
    SOURCELINK_SUFFIX: '.txt',
    NAVIGATION_WITH_KEYS: false,
    SHOW_SEARCH_SUMMARY: true,
    ENABLE_SEARCH_SHORTCUTS: true,
};


code:
/*
 * language_data.js
 * ~~~~~~~~~~~~~~~~
 *
 * This script contains the language-specific data used by searchtools.js,
 * namely the list of stopwords, stemmer, scorer and splitter.
 *
 * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
 * :license: BSD, see LICENSE for details.
 *
 */

var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"];

/* Non-minified version is copied as a separate JS file, is available */

/**
 * Porter Stemmer
 */
var Stemmer = function() {

  var step2list = {
    ational: 'ate',
    tional: 'tion',
    enci: 'ence',
    anci: 'ance',
    izer: 'ize',
    bli: 'ble',
    alli: 'al',
    entli: 'ent',
    eli: 'e',
    ousli: 'ous',
    ization: 'ize',
    ation: 'ate',
    ator: 'ate',
    alism: 'al',
    iveness: 'ive',
    fulness: 'ful',
    ousness: 'ous',
    aliti: 'al',
    iviti: 'ive',
    biliti: 'ble',
    logi: 'log'
  };

  var step3list = {
    icate: 'ic',
    ative: '',
    alize: 'al',
    iciti: 'ic',
    ical: 'ic',
    ful: '',
    ness: ''
  };

  var c = "[^aeiou]";          // consonant
  var v = "[aeiouy]";          // vowel
  var C = c + "[^aeiouy]*";    // consonant sequence
  var V = v + "[aeiou]*";      // vowel sequence

  var mgr0 = "^(" + C + ")?" + V + C;                      // [C]VC... is m>0
  var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$";    // [C]VC[V] is m=1
  var mgr1 = "^(" + C + ")?" + V + C + V + C;              // [C]VCVC... is m>1
  var s_v   = "^(" + C + ")?" + v;                         // vowel in stem

  this.stemWord = function (w) {
    var stem;
    var suffix;
    var firstch;
    var origword = w;

    if (w.length < 3)
      return w;

    var re;
    var re2;
    var re3;
    var re4;

    firstch = w.substr(0,1);
    if (firstch == "y")
      w = firstch.toUpperCase() + w.substr(1);

    // Step 1a
    re = /^(.+?)(ss|i)es$/;
    re2 = /^(.+?)([^s])s$/;

    if (re.test(w))
      w = w.replace(re,"$1$2");
    else if (re2.test(w))
      w = w.replace(re2,"$1$2");

    // Step 1b
    re = /^(.+?)eed$/;
    re2 = /^(.+?)(ed|ing)$/;
    if (re.test(w)) {
      var fp = re.exec(w);
      re = new RegExp(mgr0);
      if (re.test(fp[1])) {
        re = /.$/;
        w = w.replace(re,"");
      }
    }
    else if (re2.test(w)) {
      var fp = re2.exec(w);
      stem = fp[1];
      re2 = new RegExp(s_v);
      if (re2.test(stem)) {
        w = stem;
        re2 = /(at|bl|iz)$/;
        re3 = new RegExp("([^aeiouylsz])\\1$");
        re4 = new RegExp("^" + C + v + "[^aeiouwxy]$");
        if (re2.test(w))
          w = w + "e";
        else if (re3.test(w)) {
          re = /.$/;
          w = w.replace(re,"");
        }
        else if (re4.test(w))
          w = w + "e";
      }
    }

    // Step 1c
    re = /^(.+?)y$/;
    if (re.test(w)) {
      var fp = re.exec(w);
      stem = fp[1];
      re = new RegExp(s_v);
      if (re.test(stem))
        w = stem + "i";
    }

    // Step 2
    re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;
    if (re.test(w)) {
      var fp = re.exec(w);
      stem = fp[1];
      suffix = fp[2];
      re = new RegExp(mgr0);
      if (re.test(stem))
        w = stem + step2list[suffix];
    }

    // Step 3
    re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;
    if (re.test(w)) {
      var fp = re.exec(w);
      stem = fp[1];
      suffix = fp[2];
      re = new RegExp(mgr0);
      if (re.test(stem))
        w = stem + step3list[suffix];
    }

    // Step 4
    re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;
    re2 = /^(.+?)(s|t)(ion)$/;
    if (re.test(w)) {
      var fp = re.exec(w);
      stem = fp[1];
      re = new RegExp(mgr1);
      if (re.test(stem))
        w = stem;
    }
    else if (re2.test(w)) {
      var fp = re2.exec(w);
      stem = fp[1] + fp[2];
      re2 = new RegExp(mgr1);
      if (re2.test(stem))
        w = stem;
    }

    // Step 5
    re = /^(.+?)e$/;
    if (re.test(w)) {
      var fp = re.exec(w);
      stem = fp[1];
      re = new RegExp(mgr1);
      re2 = new RegExp(meq1);
      re3 = new RegExp("^" + C + v + "[^aeiouwxy]$");
      if (re.test(stem) || (re2.test(stem) && !(re3.test(stem))))
        w = stem;
    }
    re = /ll$/;
    re2 = new RegExp(mgr1);
    if (re.test(w) && re2.test(w)) {
      re = /.$/;
      w = w.replace(re,"");
    }

    // and turn initial Y back to y
    if (firstch == "y")
      w = firstch.toLowerCase() + w.substr(1);
    return w;
  }
}


code:
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight { background: #f8f8f8; }
.highlight .c { color: #408080; font-style: italic } /* Comment */
.highlight .o { color: #555555 } /* Operator */
.highlight .ch { color: #408080; font-style: italic } /* Comment.Hashbang */
.highlight .cm { color: #408080; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #408080; font-style: italic } /* Comment.Preproc */
.highlight .cpf { color: #408080; font-style: italic } /* Comment.PreprocFile */
.highlight .c1 { color: #408080; font-style: italic } /* Comment.Single */
.highlight .cs { color: #408080; font-style: italic } /* Comment.Special */
.highlight .m { color: #105030 } /* Literal.Number */
.highlight .s { color: #217A21 } /* Literal.String */
.highlight .na { color: #906060 } /* Name.Attribute */
.highlight .nb { color: #333333 } /* Name.Builtin */
.highlight .no { color: #4070a0 } /* Name.Constant */
.highlight .ni { color: #70A020; font-style: italic } /* Name.Entity */
.highlight .ne { color: #FF0000; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #007020 } /* Name.Function */
.highlight .nl { color: #A0A000 } /* Name.Label */
.highlight .nt { color: #bb60d5 } /* Name.Tag */
.highlight .nv { color: #1080B0 } /* Name.Variable */
.highlight .ow { color: #555555 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #105030 } /* Literal.Number.Bin */
.highlight .mf { color: #105030 } /* Literal.Number.Float */
.highlight .mh { color: #105030 } /* Literal.Number.Hex */
.highlight .mi { color: #105030 } /* Literal.Number.Integer */
.highlight .mo { color: #105030 } /* Literal.Number.Oct */
.highlight .sa { color: #217A21 } /* Literal.String.Affix */
.highlight .sb { color: #217A21 } /* Literal.String.Backtick */
.highlight .sc { color: #217A21 } /* Literal.String.Char */
.highlight .dl { color: #217A21 } /* Literal.String.Delimiter */
.highlight .sd { color: #217A21 } /* Literal.String.Doc */
.highlight .s2 { color: #217A21 } /* Literal.String.Double */
.highlight .se { color: #217A21 } /* Literal.String.Escape */
.highlight .sh { color: #217A21 } /* Literal.String.Heredoc */
.highlight .si { color: #217A21 } /* Literal.String.Interpol */
.highlight .sx { color: #217A21 } /* Literal.String.Other */
.highlight .sr { color: #217A21 } /* Literal.String.Regex */
.highlight .s1 { color: #217A21 } /* Literal.String.Single */
.highlight .ss { color: #217A21 } /* Literal.String.Symbol */
.highlight .bp { color: #333333 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #007020 } /* Name.Function.Magic */
.highlight .vc { color: #1080B0 } /* Name.Variable.Class */
.highlight .vg { color: #1080B0 } /* Name.Variable.Global */
.highlight .vi { color: #1080B0 } /* Name.Variable.Instance */
.highlight .vm { color: #1080B0 } /* Name.Variable.Magic */
.highlight .il { color: #105030 } /* Literal.Number.Integer.Long */


code:
/*
 * searchtools.js
 * ~~~~~~~~~~~~~~~~
 *
 * Sphinx JavaScript utilities for the full-text search.
 *
 * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
 * :license: BSD, see LICENSE for details.
 *
 */
"use strict";

/**
 * Simple result scoring code.
 */
if (typeof Scorer === "undefined") {
  var Scorer = {
    // Implement the following function to further tweak the score for each result
    // The function takes a result array [docname, title, anchor, descr, score, filename]
    // and returns the new score.
    /*
    score: result => {
      const [docname, title, anchor, descr, score, filename] = result
      return score
    },
    */

    // query matches the full name of an object
    objNameMatch: 11,
    // or matches in the last dotted part of the object name
    objPartialMatch: 6,
    // Additive scores depending on the priority of the object
    objPrio: {
      0: 15, // used to be importantResults
      1: 5, // used to be objectResults
      2: -5, // used to be unimportantResults
    },
    //  Used when the priority is not in the mapping.
    objPrioDefault: 0,

    // query found in title
    title: 15,
    partialTitle: 7,
    // query found in terms
    term: 5,
    partialTerm: 2,
  };
}

const _removeChildren = (element) => {
  while (element && element.lastChild) element.removeChild(element.lastChild);
};

/**
 * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#escaping
 */
const _escapeRegExp = (string) =>
  string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string

const _displayItem = (item, searchTerms) => {
  const docBuilder = DOCUMENTATION_OPTIONS.BUILDER;
  const docUrlRoot = DOCUMENTATION_OPTIONS.URL_ROOT;
  const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX;
  const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX;
  const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY;

  const [docName, title, anchor, descr, score, _filename] = item;

  let listItem = document.createElement("li");
  let requestUrl;
  let linkUrl;
  if (docBuilder === "dirhtml") {
    // dirhtml builder
    let dirname = docName + "/";
    if (dirname.match(/\/index\/$/))
      dirname = dirname.substring(0, dirname.length - 6);
    else if (dirname === "index/") dirname = "";
    requestUrl = docUrlRoot + dirname;
    linkUrl = requestUrl;
  } else {
    // normal html builders
    requestUrl = docUrlRoot + docName + docFileSuffix;
    linkUrl = docName + docLinkSuffix;
  }
  let linkEl = listItem.appendChild(document.createElement("a"));
  linkEl.href = linkUrl + anchor;
  linkEl.dataset.score = score;
  linkEl.innerHTML = title;
  if (descr)
    listItem.appendChild(document.createElement("span")).innerHTML =
      " (" + descr + ")";
  else if (showSearchSummary)
    fetch(requestUrl)
      .then((responseData) => responseData.text())
      .then((data) => {
        if (data)
          listItem.appendChild(
            Search.makeSearchSummary(data, searchTerms)
          );
      });
  Search.output.appendChild(listItem);
};
const _finishSearch = (resultCount) => {
  Search.stopPulse();
  Search.title.innerText = _("Search Results");
  if (!resultCount)
    Search.status.innerText = Documentation.gettext(
      "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories."
    );
  else
    Search.status.innerText = _(
      `Search finished, found ${resultCount} page(s) matching the search query.`
    );
};
const _displayNextItem = (
  results,
  resultCount,
  searchTerms
) => {
  // results left, load the summary and display it
  // this is intended to be dynamic (don't sub resultsCount)
  if (results.length) {
    _displayItem(results.pop(), searchTerms);
    setTimeout(
      () => _displayNextItem(results, resultCount, searchTerms),
      5
    );
  }
  // search finished, update title and status message
  else _finishSearch(resultCount);
};

/**
 * Default splitQuery function. Can be overridden in ``sphinx.search`` with a
 * custom function per language.
 *
 * The regular expression works by splitting the string on consecutive characters
 * that are not Unicode letters, numbers, underscores, or emoji characters.
 * This is the same as ``\W+`` in Python, preserving the surrogate pair area.
 */
if (typeof splitQuery === "undefined") {
  var splitQuery = (query) => query
      .split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}]+/gu)
      .filter(term => term)  // remove remaining empty strings
}

/**
 * Search Module
 */
const Search = {
  _index: null,
  _queued_query: null,
  _pulse_status: -1,

  htmlToText: (htmlString) => {
    const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html');
    htmlElement.querySelectorAll(".headerlink").forEach((el) => { el.remove() });
    const docContent = htmlElement.querySelector('[role="main"]');
    if (docContent !== undefined) return docContent.textContent;
    console.warn(
      "Content block not found. Sphinx search tries to obtain it via '[role=main]'. Could you check your theme or template."
    );
    return "";
  },

  init: () => {
    const query = new URLSearchParams(window.location.search).get("q");
    document
      .querySelectorAll('input[name="q"]')
      .forEach((el) => (el.value = query));
    if (query) Search.performSearch(query);
  },

  loadIndex: (url) =>
    (document.body.appendChild(document.createElement("script")).src = url),

  setIndex: (index) => {
    Search._index = index;
    if (Search._queued_query !== null) {
      const query = Search._queued_query;
      Search._queued_query = null;
      Search.query(query);
    }
  },

  hasIndex: () => Search._index !== null,

  deferQuery: (query) => (Search._queued_query = query),

  stopPulse: () => (Search._pulse_status = -1),

  startPulse: () => {
    if (Search._pulse_status >= 0) return;

    const pulse = () => {
      Search._pulse_status = (Search._pulse_status + 1) % 4;
      Search.dots.innerText = ".".repeat(Search._pulse_status);
      if (Search._pulse_status >= 0) window.setTimeout(pulse, 500);
    };
    pulse();
  },

  /**
   * perform a search for something (or wait until index is loaded)
   */
  performSearch: (query) => {
    // create the required interface elements
    const searchText = document.createElement("h2");
    searchText.textContent = _("Searching");
    const searchSummary = document.createElement("p");
    searchSummary.classList.add("search-summary");
    searchSummary.innerText = "";
    const searchList = document.createElement("ul");
    searchList.classList.add("search");

    const out = document.getElementById("search-results");
    Search.title = out.appendChild(searchText);
    Search.dots = Search.title.appendChild(document.createElement("span"));
    Search.status = out.appendChild(searchSummary);
    Search.output = out.appendChild(searchList);

    const searchProgress = document.getElementById("search-progress");
    // Some themes don't use the search progress node
    if (searchProgress) {
      searchProgress.innerText = _("Preparing search...");
    }
    Search.startPulse();

    // index already loaded, the browser was quick!
    if (Search.hasIndex()) Search.query(query);
    else Search.deferQuery(query);
  },

  /**
   * execute search (requires search index to be loaded)
   */
  query: (query) => {
    const filenames = Search._index.filenames;
    const docNames = Search._index.docnames;
    const titles = Search._index.titles;
    const allTitles = Search._index.alltitles;
    const indexEntries = Search._index.indexentries;

    // stem the search terms and add them to the correct list
    const stemmer = new Stemmer();
    const searchTerms = new Set();
    const excludedTerms = new Set();
    const highlightTerms = new Set();
    const objectTerms = new Set(splitQuery(query.toLowerCase().trim()));
    splitQuery(query.trim()).forEach((queryTerm) => {
      const queryTermLower = queryTerm.toLowerCase();

      // maybe skip this "word"
      // stopwords array is from language_data.js
      if (
        stopwords.indexOf(queryTermLower) !== -1 ||
        queryTerm.match(/^\d+$/)
      )
        return;

      // stem the word
      let word = stemmer.stemWord(queryTermLower);
      // select the correct list
      if (word[0] === "-") excludedTerms.add(word.substr(1));
      else {
        searchTerms.add(word);
        highlightTerms.add(queryTermLower);
      }
    });

    if (SPHINX_HIGHLIGHT_ENABLED) {  // set in sphinx_highlight.js
      localStorage.setItem("sphinx_highlight_terms", [...highlightTerms].join(" "))
    }

    // console.debug("SEARCH: searching for:");
    // console.info("required: ", [...searchTerms]);
    // console.info("excluded: ", [...excludedTerms]);

    // array of [docname, title, anchor, descr, score, filename]
    let results = [];
    _removeChildren(document.getElementById("search-progress"));

    const queryLower = query.toLowerCase();
    for (const [title, foundTitles] of Object.entries(allTitles)) {
      if (title.toLowerCase().includes(queryLower) && (queryLower.length >= title.length/2)) {
        for (const [file, id] of foundTitles) {
          let score = Math.round(100 * queryLower.length / title.length)
          results.push([
            docNames[file],
            titles[file] !== title ? `${titles[file]} > ${title}` : title,
            id !== null ? "#" + id : "",
            null,
            score,
            filenames[file],
          ]);
        }
      }
    }

    // search for explicit entries in index directives
    for (const [entry, foundEntries] of Object.entries(indexEntries)) {
      if (entry.includes(queryLower) && (queryLower.length >= entry.length/2)) {
        for (const [file, id] of foundEntries) {
          let score = Math.round(100 * queryLower.length / entry.length)
          results.push([
            docNames[file],
            titles[file],
            id ? "#" + id : "",
            null,
            score,
            filenames[file],
          ]);
        }
      }
    }

    // lookup as object
    objectTerms.forEach((term) =>
      results.push(...Search.performObjectSearch(term, objectTerms))
    );

    // lookup as search terms in fulltext
    results.push(...Search.performTermsSearch(searchTerms, excludedTerms));

    // let the scorer override scores with a custom scoring function
    if (Scorer.score) results.forEach((item) => (item[4] = Scorer.score(item)));

    // now sort the results by score (in opposite order of appearance, since the
    // display function below uses pop() to retrieve items) and then
    // alphabetically
    results.sort((a, b) => {
      const leftScore = a[4];
      const rightScore = b[4];
      if (leftScore === rightScore) {
        // same score: sort alphabetically
        const leftTitle = a[1].toLowerCase();
        const rightTitle = b[1].toLowerCase();
        if (leftTitle === rightTitle) return 0;
        return leftTitle > rightTitle ? -1 : 1; // inverted is intentional
      }
      return leftScore > rightScore ? 1 : -1;
    });

    // remove duplicate search results
    // note the reversing of results, so that in the case of duplicates, the highest-scoring entry is kept
    let seen = new Set();
    results = results.reverse().reduce((acc, result) => {
      let resultStr = result.slice(0, 4).concat([result[5]]).map(v => String(v)).join(',');
      if (!seen.has(resultStr)) {
        acc.push(result);
        seen.add(resultStr);
      }
      return acc;
    }, []);

    results = results.reverse();

    // for debugging
    //Search.lastresults = results.slice();  // a copy
    // console.info("search results:", Search.lastresults);

    // print the results
    _displayNextItem(results, results.length, searchTerms);
  },

  /**
   * search for object names
   */
  performObjectSearch: (object, objectTerms) => {
    const filenames = Search._index.filenames;
    const docNames = Search._index.docnames;
    const objects = Search._index.objects;
    const objNames = Search._index.objnames;
    const titles = Search._index.titles;

    const results = [];

    const objectSearchCallback = (prefix, match) => {
      const name = match[4]
      const fullname = (prefix ? prefix + "." : "") + name;
      const fullnameLower = fullname.toLowerCase();
      if (fullnameLower.indexOf(object) < 0) return;

      let score = 0;
      const parts = fullnameLower.split(".");

      // check for different match types: exact matches of full name or
      // "last name" (i.e. last dotted part)
      if (fullnameLower === object || parts.slice(-1)[0] === object)
        score += Scorer.objNameMatch;
      else if (parts.slice(-1)[0].indexOf(object) > -1)
        score += Scorer.objPartialMatch; // matches in last name

      const objName = objNames[match[1]][2];
      const title = titles[match[0]];

      // If more than one term searched for, we require other words to be
      // found in the name/title/description
      const otherTerms = new Set(objectTerms);
      otherTerms.delete(object);
      if (otherTerms.size > 0) {
        const haystack = `${prefix} ${name} ${objName} ${title}`.toLowerCase();
        if (
          [...otherTerms].some((otherTerm) => haystack.indexOf(otherTerm) < 0)
        )
          return;
      }

      let anchor = match[3];
      if (anchor === "") anchor = fullname;
      else if (anchor === "-") anchor = objNames[match[1]][1] + "-" + fullname;

      const descr = objName + _(", in ") + title;

      // add custom score for some objects according to scorer
      if (Scorer.objPrio.hasOwnProperty(match[2]))
        score += Scorer.objPrio[match[2]];
      else score += Scorer.objPrioDefault;

      results.push([
        docNames[match[0]],
        fullname,
        "#" + anchor,
        descr,
        score,
        filenames[match[0]],
      ]);
    };
    Object.keys(objects).forEach((prefix) =>
      objects[prefix].forEach((array) =>
        objectSearchCallback(prefix, array)
      )
    );
    return results;
  },

  /**
   * search for full-text terms in the index
   */
  performTermsSearch: (searchTerms, excludedTerms) => {
    // prepare search
    const terms = Search._index.terms;
    const titleTerms = Search._index.titleterms;
    const filenames = Search._index.filenames;
    const docNames = Search._index.docnames;
    const titles = Search._index.titles;

    const scoreMap = new Map();
    const fileMap = new Map();

    // perform the search on the required terms
    searchTerms.forEach((word) => {
      const files = [];
      const arr = [
        { files: terms[word], score: Scorer.term },
        { files: titleTerms[word], score: Scorer.title },
      ];
      // add support for partial matches
      if (word.length > 2) {
        const escapedWord = _escapeRegExp(word);
        Object.keys(terms).forEach((term) => {
          if (term.match(escapedWord) && !terms[word])
            arr.push({ files: terms[term], score: Scorer.partialTerm });
        });
        Object.keys(titleTerms).forEach((term) => {
          if (term.match(escapedWord) && !titleTerms[word])
            arr.push({ files: titleTerms[word], score: Scorer.partialTitle });
        });
      }

      // no match but word was a required one
      if (arr.every((record) => record.files === undefined)) return;

      // found search word in contents
      arr.forEach((record) => {
        if (record.files === undefined) return;

        let recordFiles = record.files;
        if (recordFiles.length === undefined) recordFiles = [recordFiles];
        files.push(...recordFiles);

        // set score for the word in each file
        recordFiles.forEach((file) => {
          if (!scoreMap.has(file)) scoreMap.set(file, {});
          scoreMap.get(file)[word] = record.score;
        });
      });

      // create the mapping
      files.forEach((file) => {
        if (fileMap.has(file) && fileMap.get(file).indexOf(word) === -1)
          fileMap.get(file).push(word);
        else fileMap.set(file, [word]);
      });
    });

    // now check if the files don't contain excluded terms
    const results = [];
    for (const [file, wordList] of fileMap) {
      // check if all requirements are matched

      // as search terms with length < 3 are discarded
      const filteredTermCount = [...searchTerms].filter(
        (term) => term.length > 2
      ).length;
      if (
        wordList.length !== searchTerms.size &&
        wordList.length !== filteredTermCount
      )
        continue;

      // ensure that none of the excluded terms is in the search result
      if (
        [...excludedTerms].some(
          (term) =>
            terms[term] === file ||
            titleTerms[term] === file ||
            (terms[term] || []).includes(file) ||
            (titleTerms[term] || []).includes(file)
        )
      )
        break;

      // select one (max) score for the file.
      const score = Math.max(...wordList.map((w) => scoreMap.get(file)[w]));
      // add result to the result list
      results.push([
        docNames[file],
        titles[file],
        "",
        null,
        score,
        filenames[file],
      ]);
    }
    return results;
  },

  /**
   * helper function to return a node containing the
   * search summary for a given text. keywords is a list
   * of stemmed words.
   */
  makeSearchSummary: (htmlText, keywords) => {
    const text = Search.htmlToText(htmlText);
    if (text === "") return null;

    const textLower = text.toLowerCase();
    const actualStartPosition = [...keywords]
      .map((k) => textLower.indexOf(k.toLowerCase()))
      .filter((i) => i > -1)
      .slice(-1)[0];
    const startWithContext = Math.max(actualStartPosition - 120, 0);

    const top = startWithContext === 0 ? "" : "...";
    const tail = startWithContext + 240 < text.length ? "..." : "";

    let summary = document.createElement("p");
    summary.classList.add("context");
    summary.textContent = top + text.substr(startWithContext, 240).trim() + tail;

    return summary;
  },
};

_ready(Search.init);


code:
/*
 * sidebar.js
 * ~~~~~~~~~~
 *
 * This script makes the Sphinx sidebar collapsible.
 *
 * .sphinxsidebar contains .sphinxsidebarwrapper.  This script adds
 * in .sphixsidebar, after .sphinxsidebarwrapper, the #sidebarbutton
 * used to collapse and expand the sidebar.
 *
 * When the sidebar is collapsed the .sphinxsidebarwrapper is hidden
 * and the width of the sidebar and the margin-left of the document
 * are decreased. When the sidebar is expanded the opposite happens.
 * This script saves a per-browser/per-session cookie used to
 * remember the position of the sidebar among the pages.
 * Once the browser is closed the cookie is deleted and the position
 * reset to the default (expanded).
 *
 * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
 * :license: BSD, see LICENSE for details.
 *
 */

const initialiseSidebar = () => {

  // global elements used by the functions.
  const bodyWrapper = document.getElementsByClassName("bodywrapper")[0]
  const sidebar = document.getElementsByClassName("sphinxsidebar")[0]
  const sidebarWrapper = document.getElementsByClassName('sphinxsidebarwrapper')[0]
  const sidebarButton = document.getElementById("sidebarbutton")
  const sidebarArrow = sidebarButton.querySelector('span')

  // for some reason, the document has no sidebar; do not run into errors
  if (typeof sidebar === "undefined") return;

  const flipArrow = element => element.innerText = (element.innerText === "»") ? "«" : "»"

  const collapse_sidebar = () => {
    bodyWrapper.style.marginLeft = ".8em";
    sidebar.style.width = ".8em"
    sidebarWrapper.style.display = "none"
    flipArrow(sidebarArrow)
    sidebarButton.title = _('Expand sidebar')
    window.localStorage.setItem("sidebar", "collapsed")
  }

  const expand_sidebar = () => {
    bodyWrapper.style.marginLeft = ""
    sidebar.style.removeProperty("width")
    sidebarWrapper.style.display = ""
    flipArrow(sidebarArrow)
    sidebarButton.title = _('Collapse sidebar')
    window.localStorage.setItem("sidebar", "expanded")
  }

  sidebarButton.addEventListener("click", () => {
    (sidebarWrapper.style.display === "none") ? expand_sidebar() : collapse_sidebar()
  })

  if (!window.localStorage.getItem("sidebar")) return
  const value = window.localStorage.getItem("sidebar")
  if (value === "collapsed") collapse_sidebar();
  else if (value === "expanded") expand_sidebar();
}

if (document.readyState !== "loading") initialiseSidebar()
else document.addEventListener("DOMContentLoaded", initialiseSidebar)


code:
/* Highlighting utilities for Sphinx HTML documentation. */
"use strict";

const SPHINX_HIGHLIGHT_ENABLED = true

/**
 * highlight a given string on a node by wrapping it in
 * span elements with the given class name.
 */
const _highlight = (node, addItems, text, className) => {
  if (node.nodeType === Node.TEXT_NODE) {
    const val = node.nodeValue;
    const parent = node.parentNode;
    const pos = val.toLowerCase().indexOf(text);
    if (
      pos >= 0 &&
      !parent.classList.contains(className) &&
      !parent.classList.contains("nohighlight")
    ) {
      let span;

      const closestNode = parent.closest("body, svg, foreignObject");
      const isInSVG = closestNode && closestNode.matches("svg");
      if (isInSVG) {
        span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
      } else {
        span = document.createElement("span");
        span.classList.add(className);
      }

      span.appendChild(document.createTextNode(val.substr(pos, text.length)));
      parent.insertBefore(
        span,
        parent.insertBefore(
          document.createTextNode(val.substr(pos + text.length)),
          node.nextSibling
        )
      );
      node.nodeValue = val.substr(0, pos);

      if (isInSVG) {
        const rect = document.createElementNS(
          "http://www.w3.org/2000/svg",
          "rect"
        );
        const bbox = parent.getBBox();
        rect.x.baseVal.value = bbox.x;
        rect.y.baseVal.value = bbox.y;
        rect.width.baseVal.value = bbox.width;
        rect.height.baseVal.value = bbox.height;
        rect.setAttribute("class", className);
        addItems.push({ parent: parent, target: rect });
      }
    }
  } else if (node.matches && !node.matches("button, select, textarea")) {
    node.childNodes.forEach((el) => _highlight(el, addItems, text, className));
  }
};
const _highlightText = (thisNode, text, className) => {
  let addItems = [];
  _highlight(thisNode, addItems, text, className);
  addItems.forEach((obj) =>
    obj.parent.insertAdjacentElement("beforebegin", obj.target)
  );
};

/**
 * Small JavaScript module for the documentation.
 */
const SphinxHighlight = {

  /**
   * highlight the search words provided in localstorage in the text
   */
  highlightSearchWords: () => {
    if (!SPHINX_HIGHLIGHT_ENABLED) return;  // bail if no highlight

    // get and clear terms from localstorage
    const url = new URL(window.location);
    const highlight =
        localStorage.getItem("sphinx_highlight_terms")
        || url.searchParams.get("highlight")
        || "";
    localStorage.removeItem("sphinx_highlight_terms")
    url.searchParams.delete("highlight");
    window.history.replaceState({}, "", url);

    // get individual terms from highlight string
    const terms = highlight.toLowerCase().split(/\s+/).filter(x => x);
    if (terms.length === 0) return; // nothing to do

    // There should never be more than one element matching "div.body"
    const divBody = document.querySelectorAll("div.body");
    const body = divBody.length ? divBody[0] : document.querySelector("body");
    window.setTimeout(() => {
      terms.forEach((term) => _highlightText(body, term, "highlighted"));
    }, 10);

    const searchBox = document.getElementById("searchbox");
    if (searchBox === null) return;
    searchBox.appendChild(
      document
        .createRange()
        .createContextualFragment(
          '
' +
            '' +
            _("Hide Search Matches") +
            "
"
        )
    );
  },

  /**
   * helper function to hide the search marks again
   */
  hideSearchWords: () => {
    document
      .querySelectorAll("#searchbox .highlight-link")
      .forEach((el) => el.remove());
    document
      .querySelectorAll("span.highlighted")
      .forEach((el) => el.classList.remove("highlighted"));
    localStorage.removeItem("sphinx_highlight_terms")
  },

  initEscapeListener: () => {
    // only install a listener if it is really needed
    if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return;

    document.addEventListener("keydown", (event) => {
      // bail for input elements
      if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return;
      // bail with special keys
      if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return;
      if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) {
        SphinxHighlight.hideSearchWords();
        event.preventDefault();
      }
    });
  },
};

_ready(SphinxHighlight.highlightSearchWords);
_ready(SphinxHighlight.initEscapeListener);


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>add_compile_definitions — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="add_compile_options" href="add_compile_options.html" />
    <link rel="prev" title="while" href="while.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-commands(7) »

add_compile_definitions

add_compile_definitions¶

New in version 3.12.

Add preprocessor definitions to the compilation of source files.

add_compile_definitions(<definition> ...)

Adds preprocessor definitions to the compiler command line.

The preprocessor definitions are added to the COMPILE_DEFINITIONS
directory property for the current CMakeLists file. They are also added to
the COMPILE_DEFINITIONS target property for each target in the
current CMakeLists file.

Definitions are specified using the syntax VAR or VAR=value.
Function-style definitions are not supported. CMake will automatically
escape the value correctly for the native build system (note that CMake
language syntax may require escapes to specify some values).

New in version 3.26: Any leading -D on an item will be removed.

Arguments to add_compile_definitions may use generator expressions
with the syntax $<...>. See the cmake-generator-expressions(7)
manual for available expressions.  See the cmake-buildsystem(7) manual
for more on defining buildsystem properties.

See Also¶

The command target_compile_definitions() adds target-specific definitions.

Table of Contents

add_compile_definitions

See Also

Previous topic

while

Next topic

add_compile_options

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-commands(7) »

add_compile_definitions

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>add_compile_options — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="add_custom_command" href="add_custom_command.html" />
    <link rel="prev" title="add_compile_definitions" href="add_compile_definitions.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-commands(7) »

add_compile_options

add_compile_options¶

Add options to the compilation of source files.

add_compile_options(<option> ...)

Adds options to the COMPILE_OPTIONS directory property.
These options are used when compiling targets from the current
directory and below.

Note

These options are not used when linking.
See the add_link_options() command for that.

Arguments¶

Arguments to add_compile_options may use generator expressions
with the syntax $<...>. See the cmake-generator-expressions(7)
manual for available expressions.  See the cmake-buildsystem(7) manual
for more on defining buildsystem properties.

Option De-duplication¶

The final set of options used for a target is constructed by
accumulating options from the current target and the usage requirements of
its dependencies.  The set of options is de-duplicated to avoid repetition.

New in version 3.12: While beneficial for individual options, the de-duplication step can break
up option groups.  For example, -option A -option B becomes
-option A B.  One may specify a group of options using shell-like
quoting along with a SHELL: prefix.  The SHELL: prefix is dropped,
and the rest of the option string is parsed using the
separate_arguments() UNIX_COMMAND mode. For example,
"SHELL:-option A" "SHELL:-option B" becomes -option A -option B.

Example¶

Since different compilers support different options, a typical use of
this command is in a compiler-specific conditional clause:

if (MSVC)
    # warning level 4
    add_compile_options(/W4)
else()
    # additional warnings
    add_compile_options(-Wall -Wextra -Wpedantic)
endif()

To set per-language options, use the $<COMPILE_LANGUAGE>
or $<COMPILE_LANGUAGE:languages> generator expressions.

See Also¶

This command can be used to add any options. However, for
adding preprocessor definitions and include directories it is recommended
to use the more specific commands add_compile_definitions()
and include_directories().

The command target_compile_options() adds target-specific options.

This command adds compile options for all languages.
Use the COMPILE_LANGUAGE generator expression to specify
per-language compile options.

The source file property COMPILE_OPTIONS adds options to one
source file.

add_link_options() adds options for linking.

CMAKE_<LANG>_FLAGS and CMAKE_<LANG>_FLAGS_<CONFIG>
add language-wide flags passed to all invocations of the compiler.
This includes invocations that drive compiling and those that drive linking.

Table of Contents

add_compile_options

Arguments

Option De-duplication

Example

See Also

Previous topic

add_compile_definitions

Next topic

add_custom_command

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-commands(7) »

add_compile_options

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>add_custom_command — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="add_custom_target" href="add_custom_target.html" />
    <link rel="prev" title="add_compile_options" href="add_compile_options.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-commands(7) »

add_custom_command

add_custom_command¶

Add a custom build rule to the generated build system.

There are two main signatures for add_custom_command.

Generating Files¶

The first signature is for adding a custom command to produce an output:

add_custom_command(OUTPUT output1 [output2 ...]
                   COMMAND command1 [ARGS] [args1...]
                   [COMMAND command2 [ARGS] [args2...] ...]
                   [MAIN_DEPENDENCY depend]
                   [DEPENDS [depends...]]
                   [BYPRODUCTS [files...]]
                   [IMPLICIT_DEPENDS <lang1> depend1
                                    [<lang2> depend2] ...]
                   [WORKING_DIRECTORY dir]
                   [COMMENT comment]
                   [DEPFILE depfile]
                   [JOB_POOL job_pool]
                   [JOB_SERVER_AWARE <bool>]
                   [VERBATIM] [APPEND] [USES_TERMINAL]
                   [COMMAND_EXPAND_LISTS]
                   [DEPENDS_EXPLICIT_ONLY])

This defines a command to generate specified OUTPUT file(s).
A target created in the same directory (CMakeLists.txt file)
that specifies any output of the custom command as a source file
is given a rule to generate the file using the command at build time.

Do not list the output in more than one independent target that
may build in parallel or the instances of the rule may conflict.
Instead, use the add_custom_target() command to drive the
command and make the other targets depend on that one.  See the
Example: Generating Files for Multiple Targets below.

The options are:

APPEND

Append the COMMAND and DEPENDS option values to the custom
command for the first output specified.  There must have already
been a previous call to this command with the same output.

If the previous call specified the output via a generator expression,
the output specified by the current call must match in at least one
configuration after evaluating generator expressions.  In this case,
the appended commands and dependencies apply to all configurations.

The COMMENT, MAIN_DEPENDENCY, and WORKING_DIRECTORY
options are currently ignored when APPEND is given, but may be
used in the future.

BYPRODUCTS

New in version 3.2.

Specify the files the command is expected to produce but whose
modification time may or may not be newer than the dependencies.
If a byproduct name is a relative path it will be interpreted
relative to the build tree directory corresponding to the
current source directory.
Each byproduct file will be marked with the GENERATED
source file property automatically.

See policy CMP0058 for the motivation behind this feature.

Explicit specification of byproducts is supported by the
Ninja generator to tell the ninja build tool
how to regenerate byproducts when they are missing.  It is
also useful when other build rules (e.g. custom commands)
depend on the byproducts.  Ninja requires a build rule for any
generated file on which another rule depends even if there are
order-only dependencies to ensure the byproducts will be
available before their dependents build.

The Makefile Generators will remove BYPRODUCTS and other
GENERATED files during make clean.

New in version 3.20: Arguments to BYPRODUCTS may use a restricted set of
generator expressions.
Target-dependent expressions are not
permitted.

Changed in version 3.28: In targets using File Sets, custom command byproducts are now
considered private unless they are listed in a non-private file set.
See policy CMP0154.

COMMAND

Specify the command-line(s) to execute at build time.
If more than one COMMAND is specified they will be executed in order,
but not necessarily composed into a stateful shell or batch script.
(To run a full script, use the configure_file() command or the
file(GENERATE) command to create it, and then specify
a COMMAND to launch it.)
The optional ARGS argument is for backward compatibility and
will be ignored.

If COMMAND specifies an executable target name (created by the
add_executable() command), it will automatically be replaced
by the location of the executable created at build time if either of
the following is true:

The target is not being cross-compiled (i.e. the
CMAKE_CROSSCOMPILING variable is not set to true).

New in version 3.6: The target is being cross-compiled and an emulator is provided (i.e.
its CROSSCOMPILING_EMULATOR target property is set).
In this case, the contents of CROSSCOMPILING_EMULATOR will be
prepended to the command before the location of the target executable.

If neither of the above conditions are met, it is assumed that the
command name is a program to be found on the PATH at build time.

Arguments to COMMAND may use
generator expressions.
Use the TARGET_FILE generator expression to refer to the location
of a target later in the command line (i.e. as a command argument rather
than as the command to execute).

Whenever one of the following target based generator expressions are used as
a command to execute or is mentioned in a command argument, a target-level
dependency will be added automatically so that the mentioned target will be
built before any target using this custom command
(see policy CMP0112).

TARGET_FILE

TARGET_LINKER_FILE

TARGET_SONAME_FILE

TARGET_PDB_FILE

This target-level dependency does NOT add a file-level dependency that would
cause the custom command to re-run whenever the executable is recompiled.
List target names with the DEPENDS option to add such file-level
dependencies.

COMMENT

Display the given message before the commands are executed at
build time.

New in version 3.26: Arguments to COMMENT may use
generator expressions.

DEPENDS

Specify files on which the command depends.  Each argument is converted
to a dependency as follows:

If the argument is the name of a target (created by the
add_custom_target(), add_executable(), or
add_library() command) a target-level dependency is
created to make sure the target is built before any target
using this custom command.  Additionally, if the target is an
executable or library, a file-level dependency is created to
cause the custom command to re-run whenever the target is
recompiled.

If the argument is an absolute path, a file-level dependency
is created on that path.

If the argument is the name of a source file that has been
added to a target or on which a source file property has been set,
a file-level dependency is created on that source file.

If the argument is a relative path and it exists in the current
source directory, a file-level dependency is created on that
file in the current source directory.

Otherwise, a file-level dependency is created on that path relative
to the current binary directory.

If any dependency is an OUTPUT of another custom command in the same
directory (CMakeLists.txt file), CMake automatically brings the other
custom command into the target in which this command is built.

New in version 3.16: A target-level dependency is added if any dependency is listed as
BYPRODUCTS of a target or any of its build events in the same
directory to ensure the byproducts will be available.

If DEPENDS is not specified, the command will run whenever
the OUTPUT is missing; if the command does not actually
create the OUTPUT, the rule will always run.

New in version 3.1: Arguments to DEPENDS may use
generator expressions.

COMMAND_EXPAND_LISTS

New in version 3.8.

Lists in COMMAND arguments will be expanded, including those
created with
generator expressions,
allowing COMMAND arguments such as
${CC} "-I$<JOIN:$<TARGET_PROPERTY:foo,INCLUDE_DIRECTORIES>,;-I>" foo.cc
to be properly expanded.

IMPLICIT_DEPENDS

Request scanning of implicit dependencies of an input file.
The language given specifies the programming language whose
corresponding dependency scanner should be used.
Currently only C and CXX language scanners are supported.
The language has to be specified for every file in the
IMPLICIT_DEPENDS list.  Dependencies discovered from the
scanning are added to those of the custom command at build time.
Note that the IMPLICIT_DEPENDS option is currently supported
only for Makefile generators and will be ignored by other generators.

Note

This option cannot be specified at the same time as DEPFILE option.

JOB_POOL

New in version 3.15.

Specify a pool for the Ninja
generator. Incompatible with USES_TERMINAL, which implies
the console pool.
Using a pool that is not defined by JOB_POOLS causes
an error by ninja at build time.

JOB_SERVER_AWARE

New in version 3.28.

Specify that the command is GNU Make job server aware.

For the Unix Makefiles, MSYS Makefiles, and
MinGW Makefiles generators this will add the + prefix to the
recipe line. See the GNU Make Documentation for more information.

This option is silently ignored by other generators.

MAIN_DEPENDENCY

Specify the primary input source file to the command.  This is
treated just like any value given to the DEPENDS option
but also suggests to Visual Studio generators where to hang
the custom command. Each source file may have at most one command
specifying it as its main dependency. A compile command (i.e. for a
library or an executable) counts as an implicit main dependency which
gets silently overwritten by a custom command specification.

OUTPUT

Specify the output files the command is expected to produce.
Each output file will be marked with the GENERATED
source file property automatically.
If the output of the custom command is not actually created
as a file on disk it should be marked with the SYMBOLIC
source file property.

If an output file name is a relative path, its absolute path is
determined by interpreting it relative to:

the build directory corresponding to the current source directory
(CMAKE_CURRENT_BINARY_DIR), or

the current source directory (CMAKE_CURRENT_SOURCE_DIR).

The path in the build directory is preferred unless the path in the
source tree is mentioned as an absolute source file path elsewhere
in the current directory.

New in version 3.20: Arguments to OUTPUT may use a restricted set of
generator expressions.
Target-dependent expressions are not
permitted.

Changed in version 3.28: In targets using File Sets, custom command outputs are now
considered private unless they are listed in a non-private file set.
See policy CMP0154.

USES_TERMINAL

New in version 3.2.

The command will be given direct access to the terminal if possible.
With the Ninja generator, this places the command in
the console pool.

VERBATIM

All arguments to the commands will be escaped properly for the
build tool so that the invoked command receives each argument
unchanged.  Note that one level of escapes is still used by the
CMake language processor before add_custom_command even sees the
arguments.  Use of VERBATIM is recommended as it enables
correct behavior.  When VERBATIM is not given the behavior
is platform specific because there is no protection of
tool-specific special characters.

WORKING_DIRECTORY

Execute the command with the given current working directory.
If it is a relative path it will be interpreted relative to the
build tree directory corresponding to the current source directory.

New in version 3.13: Arguments to WORKING_DIRECTORY may use
generator expressions.

DEPFILE

New in version 3.7.

Specify a depfile which holds dependencies for the custom command. It is
usually emitted by the custom command itself.  This keyword may only be used
if the generator supports it, as detailed below.

The expected format, compatible with what is generated by gcc with the
option -M, is independent of the generator or platform.

The formal syntax, as specified using
BNF notation with
the regular extensions, is the following:

depfile       ::=  rule*
rule          ::=  targets (':' (separator dependencies?)?)? eol
targets       ::=  target (separator target)* separator*
target        ::=  pathname
dependencies  ::=  dependency (separator dependency)* separator*
dependency    ::=  pathname
separator     ::=  (space | line_continue)+
line_continue ::=  '\' eol
space         ::=  ' ' | '\t'
pathname      ::=  character+
character     ::=  std_character | dollar | hash | whitespace
std_character ::=  <any character except '$', '#' or ' '>
dollar        ::=  '$$'
hash          ::=  '\#'
whitespace    ::=  '\ '
eol           ::=  '\r'? '\n'

Note

As part of pathname, any slash and backslash is interpreted as
a directory separator.

New in version 3.7: The Ninja generator supports DEPFILE since the keyword
was first added.

New in version 3.17: Added the Ninja Multi-Config generator, which included
support for the DEPFILE keyword.

New in version 3.20: Added support for Makefile Generators.

Note

DEPFILE cannot be specified at the same time as the
IMPLICIT_DEPENDS option for Makefile Generators.

New in version 3.21: Added support for Visual Studio Generators with VS 2012 and above,
and for the Xcode generator.  Support for
generator expressions was also
added.

New in version 3.29: The Ninja Generators will now incorporate the dependencies into its
"deps log" database if the file is not listed in OUTPUTS or
BYPRODUCTS.

Using DEPFILE with generators other than those listed above is an error.

If the DEPFILE argument is relative, it should be relative to
CMAKE_CURRENT_BINARY_DIR, and any relative paths inside the
DEPFILE should also be relative to CMAKE_CURRENT_BINARY_DIR.
See policy CMP0116, which is always NEW for
Makefile Generators, Visual Studio Generators,
and the Xcode generator.

DEPENDS_EXPLICIT_ONLY

New in version 3.27.

Indicates that the command's DEPENDS argument represents all files
required by the command and implicit dependencies are not required.

Without this option, if any target uses the output of the custom command,
CMake will consider that target's dependencies as implicit dependencies for
the custom command in case this custom command requires files implicitly
created by those targets.

This option can be enabled on all custom commands by setting
CMAKE_ADD_CUSTOM_COMMAND_DEPENDS_EXPLICIT_ONLY to ON.

Only the Ninja Generators actually use this information to remove
unnecessary implicit dependencies.

See also the OPTIMIZE_DEPENDENCIES target property, which may
provide another way for reducing the impact of target dependencies in some
scenarios.

Examples: Generating Files¶

Custom commands may be used to generate source files.
For example, the code:

add_custom_command(
  OUTPUT out.c
  COMMAND someTool -i ${CMAKE_CURRENT_SOURCE_DIR}/in.txt
                   -o out.c
  DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/in.txt
  VERBATIM)
add_library(myLib out.c)

adds a custom command to run someTool to generate out.c and then
compile the generated source as part of a library.  The generation rule
will re-run whenever in.txt changes.

New in version 3.20: One may use generator expressions to specify per-configuration outputs.
For example, the code:

add_custom_command(
  OUTPUT "out-$<CONFIG>.c"
  COMMAND someTool -i ${CMAKE_CURRENT_SOURCE_DIR}/in.txt
                   -o "out-$<CONFIG>.c"
                   -c "$<CONFIG>"
  DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/in.txt
  VERBATIM)
add_library(myLib "out-$<CONFIG>.c")

adds a custom command to run someTool to generate out-<config>.c,
where <config> is the build configuration, and then compile the generated
source as part of a library.

Example: Generating Files for Multiple Targets¶

If multiple independent targets need the same custom command output,
it must be attached to a single custom target on which they all depend.
Consider the following example:

add_custom_command(
  OUTPUT table.csv
  COMMAND makeTable -i ${CMAKE_CURRENT_SOURCE_DIR}/input.dat
                    -o table.csv
  DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/input.dat
  VERBATIM)
add_custom_target(generate_table_csv DEPENDS table.csv)

add_custom_command(
  OUTPUT foo.cxx
  COMMAND genFromTable -i table.csv -case foo -o foo.cxx
  DEPENDS table.csv           # file-level dependency
          generate_table_csv  # target-level dependency
  VERBATIM)
add_library(foo foo.cxx)

add_custom_command(
  OUTPUT bar.cxx
  COMMAND genFromTable -i table.csv -case bar -o bar.cxx
  DEPENDS table.csv           # file-level dependency
          generate_table_csv  # target-level dependency
  VERBATIM)
add_library(bar bar.cxx)

Output foo.cxx is needed only by target foo and output bar.cxx
is needed only by target bar, but both targets need table.csv,
transitively.  Since foo and bar are independent targets that may
build concurrently, we prevent them from racing to generate table.csv
by placing its custom command in a separate target, generate_table_csv.
The custom commands generating foo.cxx and bar.cxx each specify a
target-level dependency on generate_table_csv, so the targets using them,
foo and bar, will not build until after target generate_table_csv
is built.

Build Events¶

The second signature adds a custom command to a target such as a
library or executable.  This is useful for performing an operation
before or after building the target.  The command becomes part of the
target and will only execute when the target itself is built.  If the
target is already built, the command will not execute.

add_custom_command(TARGET <target>
                   PRE_BUILD | PRE_LINK | POST_BUILD
                   COMMAND command1 [ARGS] [args1...]
                   [COMMAND command2 [ARGS] [args2...] ...]
                   [BYPRODUCTS [files...]]
                   [WORKING_DIRECTORY dir]
                   [COMMENT comment]
                   [VERBATIM]
                   [COMMAND_EXPAND_LISTS])

This defines a new command that will be associated with building the
specified <target>.  The <target> must be defined in the current
directory; targets defined in other directories may not be specified.

When the command will happen is determined by which
of the following is specified:

PRE_BUILD

This option has unique behavior for the Visual Studio Generators.
When using one of the Visual Studio generators, the command will run before
any other rules are executed within the target.  With all other generators,
this option behaves the same as PRE_LINK instead.  Because of this,
it is recommended to avoid using PRE_BUILD except when it is known that
a Visual Studio generator is being used.

PRE_LINK

Run after sources have been compiled but before linking the binary
or running the librarian or archiver tool of a static library.
This is not defined for targets created by the
add_custom_target() command.

POST_BUILD

Run after all other rules within the target have been executed.

Projects should always specify one of the above three keywords when using
the TARGET form.  For backward compatibility reasons, POST_BUILD is
assumed if no such keyword is given, but projects should explicitly provide
one of the keywords to make clear the behavior they expect.

Note

Because generator expressions can be used in custom commands,
it is possible to define COMMAND lines or whole custom commands
which evaluate to empty strings for certain configurations.
For Visual Studio 12 2013 (and newer) generators these command
lines or custom commands will be omitted for the specific
configuration and no "empty-string-command" will be added.

This allows adding individual build events for every configuration.

New in version 3.21: Support for target-dependent generator expressions.

New in version 3.29: The <target> may be an ALIAS target.

Examples: Build Events¶

A POST_BUILD event may be used to post-process a binary after linking.
For example, the code:

add_executable(myExe myExe.c)
add_custom_command(
  TARGET myExe POST_BUILD
  COMMAND someHasher -i "$<TARGET_FILE:myExe>"
                     -o "$<TARGET_FILE:myExe>.hash"
  VERBATIM)

will run someHasher to produce a .hash file next to the executable
after linking.

New in version 3.20: One may use generator expressions to specify per-configuration byproducts.
For example, the code:

add_library(myPlugin MODULE myPlugin.c)
add_custom_command(
  TARGET myPlugin POST_BUILD
  COMMAND someHasher -i "$<TARGET_FILE:myPlugin>"
                     --as-code "myPlugin-hash-$<CONFIG>.c"
  BYPRODUCTS "myPlugin-hash-$<CONFIG>.c"
  VERBATIM)
add_executable(myExe myExe.c "myPlugin-hash-$<CONFIG>.c")

will run someHasher after linking myPlugin, e.g. to produce a .c
file containing code to check the hash of myPlugin that the myExe
executable can use to verify it before loading.

Ninja Multi-Config¶

New in version 3.20: add_custom_command supports the Ninja Multi-Config
generator's cross-config capabilities. See the generator documentation
for more information.

See Also¶

add_custom_target()

Table of Contents

add_custom_command

Generating Files

Examples: Generating Files

Example: Generating Files for Multiple Targets

Build Events

Examples: Build Events

Ninja Multi-Config

See Also

Previous topic

add_compile_options

Next topic

add_custom_target

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-commands(7) »

add_custom_command

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.


code:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <title>add_custom_target — CMake 3.29.0-rc3 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css" />

    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="add_definitions" href="add_definitions.html" />
    <link rel="prev" title="add_custom_command" href="add_custom_command.html" />

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-commands(7) »

add_custom_target

add_custom_target¶

Add a target with no output so it will always be built.

add_custom_target(Name [ALL] [command1 [args1...]]
                  [COMMAND command2 [args2...] ...]
                  [DEPENDS depend depend depend ... ]
                  [BYPRODUCTS [files...]]
                  [WORKING_DIRECTORY dir]
                  [COMMENT comment]
                  [JOB_POOL job_pool]
                  [JOB_SERVER_AWARE <bool>]
                  [VERBATIM] [USES_TERMINAL]
                  [COMMAND_EXPAND_LISTS]
                  [SOURCES src1 [src2...]])

Adds a target with the given name that executes the given commands.
The target has no output file and is always considered out of date
even if the commands try to create a file with the name of the target.
Use the add_custom_command() command to generate a file with
dependencies.  By default nothing depends on the custom target.  Use
the add_dependencies() command to add dependencies to or
from other targets.

The options are:

ALL

Indicate that this target should be added to the default build
target so that it will be run every time (the command cannot be
called ALL).

BYPRODUCTS

New in version 3.2.

Specify the files the command is expected to produce but whose
modification time may or may not be updated on subsequent builds.
If a byproduct name is a relative path it will be interpreted
relative to the build tree directory corresponding to the
current source directory.
Each byproduct file will be marked with the GENERATED
source file property automatically.

See policy CMP0058 for the motivation behind this feature.

Explicit specification of byproducts is supported by the
Ninja generator to tell the ninja build tool
how to regenerate byproducts when they are missing.  It is
also useful when other build rules (e.g. custom commands)
depend on the byproducts.  Ninja requires a build rule for any
generated file on which another rule depends even if there are
order-only dependencies to ensure the byproducts will be
available before their dependents build.

The Makefile Generators will remove BYPRODUCTS and other
GENERATED files during make clean.

New in version 3.20: Arguments to BYPRODUCTS may use a restricted set of
generator expressions.
Target-dependent expressions are not
permitted.

Changed in version 3.28: In custom targets using File Sets, byproducts are now
considered private unless they are listed in a non-private file set.
See policy CMP0154.

COMMAND

Specify the command-line(s) to execute at build time.
If more than one COMMAND is specified they will be executed in order,
but not necessarily composed into a stateful shell or batch script.
(To run a full script, use the configure_file() command or the
file(GENERATE) command to create it, and then specify
a COMMAND to launch it.)

If COMMAND specifies an executable target name (created by the
add_executable() command), it will automatically be replaced
by the location of the executable created at build time if either of
the following is true:

The target is not being cross-compiled (i.e. the
CMAKE_CROSSCOMPILING variable is not set to true).

New in version 3.6: The target is being cross-compiled and an emulator is provided (i.e.
its CROSSCOMPILING_EMULATOR target property is set).
In this case, the contents of CROSSCOMPILING_EMULATOR will be
prepended to the command before the location of the target executable.

If neither of the above conditions are met, it is assumed that the
command name is a program to be found on the PATH at build time.

Arguments to COMMAND may use
generator expressions.
Use the TARGET_FILE generator expression to refer to the location
of a target later in the command line (i.e. as a command argument rather
than as the command to execute).

Whenever one of the following target based generator expressions are used as
a command to execute or is mentioned in a command argument, a target-level
dependency will be added automatically so that the mentioned target will be
built before this custom target (see policy CMP0112).

TARGET_FILE

TARGET_LINKER_FILE

TARGET_SONAME_FILE

TARGET_PDB_FILE

The command and arguments are optional and if not specified an empty
target will be created.

COMMENT

Display the given message before the commands are executed at
build time.

New in version 3.26: Arguments to COMMENT may use
generator expressions.

DEPENDS

Reference files and outputs of custom commands created with
add_custom_command() command calls in the same directory
(CMakeLists.txt file).  They will be brought up to date when
the target is built.

Changed in version 3.16: A target-level dependency is added if any dependency is a byproduct
of a target or any of its build events in the same directory to ensure
the byproducts will be available before this target is built.

Use the add_dependencies() command to add dependencies
on other targets.

COMMAND_EXPAND_LISTS

New in version 3.8.

Lists in COMMAND arguments will be expanded, including those
created with
generator expressions,
allowing COMMAND arguments such as
${CC} "-I$<JOIN:$<TARGET_PROPERTY:foo,INCLUDE_DIRECTORIES>,;-I>" foo.cc
to be properly expanded.

JOB_POOL

New in version 3.15.

Specify a pool for the Ninja
generator. Incompatible with USES_TERMINAL, which implies
the console pool.
Using a pool that is not defined by JOB_POOLS causes
an error by ninja at build time.

JOB_SERVER_AWARE

New in version 3.28.

Specify that the command is GNU Make job server aware.

For the Unix Makefiles, MSYS Makefiles, and
MinGW Makefiles generators this will add the + prefix to the
recipe line. See the GNU Make Documentation for more information.

This option is silently ignored by other generators.

SOURCES

Specify additional source files to be included in the custom target.
Specified source files will be added to IDE project files for
convenience in editing even if they have no build rules.

VERBATIM

All arguments to the commands will be escaped properly for the
build tool so that the invoked command receives each argument
unchanged.  Note that one level of escapes is still used by the
CMake language processor before add_custom_target even sees
the arguments.  Use of VERBATIM is recommended as it enables
correct behavior.  When VERBATIM is not given the behavior
is platform specific because there is no protection of
tool-specific special characters.

USES_TERMINAL

New in version 3.2.

The command will be given direct access to the terminal if possible.
With the Ninja generator, this places the command in
the console pool.

WORKING_DIRECTORY

Execute the command with the given current working directory.
If it is a relative path it will be interpreted relative to the
build tree directory corresponding to the current source directory.

New in version 3.13: Arguments to WORKING_DIRECTORY may use
generator expressions.

Ninja Multi-Config¶

New in version 3.20: add_custom_target supports the Ninja Multi-Config
generator's cross-config capabilities. See the generator documentation
for more information.

See Also¶

add_custom_command()

Table of Contents

add_custom_target

Ninja Multi-Config

See Also

Previous topic

add_custom_command

Next topic

add_definitions

This Page

Show Source

Quick search

    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>

Navigation

          index

          next |

          previous |

    CMake »

    3.29.0-rc3 Documentation »

cmake-commands(7) »

add_custom_target

        © Copyright 2000-2024 Kitware, Inc. and Contributors.
      Created using Sphinx 6.2.1.