From 0df3e730a053f37eceef9ce4f5c8b2389afb09e8 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sat, 10 May 2025 16:54:38 -0500 Subject: [PATCH] Add 'xo-indentlog/' from commit '624178f1932508a687d85ddea56d03998193207a' git-subtree-dir: xo-indentlog git-subtree-mainline: 624178f1932508a687d85ddea56d03998193207a git-subtree-split: 624178f1932508a687d85ddea56d03998193207a --- .../.github/workflows/main-stock-ubuntu.yml | 37 + xo-indentlog/.gitignore | 2 + xo-indentlog/CMakeLists.txt | 104 + xo-indentlog/README.md | 85 + xo-indentlog/default.nix | 94 + xo-indentlog/pkgs/xo-cmake.nix | 15 + xo-indentlog/pkgs/xo-indentlog.nix | 18 + xo-indentlog/pkgs/xo-userenv.nix | 99 + .../.github/workflows/xo-cpp-main.yml | 74 + xo-indentlog/xo-cmake/.gitignore | 3 + xo-indentlog/xo-cmake/CMakeLists.txt | 67 + xo-indentlog/xo-cmake/FAQ | 120 + xo-indentlog/xo-cmake/README.md | 61 + xo-indentlog/xo-cmake/bin/xo-build.in | 220 ++ xo-indentlog/xo-cmake/bin/xo-cmake-config.in | 86 + .../xo-cmake/bin/xo-cmake-lcov-harness.in | 121 + .../cmake/xo_macros/code-coverage.cmake | 678 ++++ .../cmake/xo_macros/xo-project-macros.cmake | 2 + .../xo-cmake/cmake/xo_macros/xo_cxx.cmake | 1426 +++++++++ xo-indentlog/xo-cmake/etc/xo/subsystem-list | 38 + .../xo-cmake/share/xo-macros/Doxyfile.in | 2816 +++++++++++++++++ .../xo-cmake/share/xo-macros/gen-ccov.in | 30 + .../share/xo-macros/xo-bootstrap-macros.cmake | 35 + 23 files changed, 6231 insertions(+) create mode 100644 xo-indentlog/.github/workflows/main-stock-ubuntu.yml create mode 100644 xo-indentlog/.gitignore create mode 100644 xo-indentlog/CMakeLists.txt create mode 100644 xo-indentlog/README.md create mode 100644 xo-indentlog/default.nix create mode 100644 xo-indentlog/pkgs/xo-cmake.nix create mode 100644 xo-indentlog/pkgs/xo-indentlog.nix create mode 100644 xo-indentlog/pkgs/xo-userenv.nix create mode 100644 xo-indentlog/xo-cmake/.github/workflows/xo-cpp-main.yml create mode 100644 xo-indentlog/xo-cmake/.gitignore create mode 100644 xo-indentlog/xo-cmake/CMakeLists.txt create mode 100644 xo-indentlog/xo-cmake/FAQ create mode 100644 xo-indentlog/xo-cmake/README.md create mode 100644 xo-indentlog/xo-cmake/bin/xo-build.in create mode 100755 xo-indentlog/xo-cmake/bin/xo-cmake-config.in create mode 100755 xo-indentlog/xo-cmake/bin/xo-cmake-lcov-harness.in create mode 100644 xo-indentlog/xo-cmake/cmake/xo_macros/code-coverage.cmake create mode 100644 xo-indentlog/xo-cmake/cmake/xo_macros/xo-project-macros.cmake create mode 100644 xo-indentlog/xo-cmake/cmake/xo_macros/xo_cxx.cmake create mode 100644 xo-indentlog/xo-cmake/etc/xo/subsystem-list create mode 100644 xo-indentlog/xo-cmake/share/xo-macros/Doxyfile.in create mode 100644 xo-indentlog/xo-cmake/share/xo-macros/gen-ccov.in create mode 100644 xo-indentlog/xo-cmake/share/xo-macros/xo-bootstrap-macros.cmake diff --git a/xo-indentlog/.github/workflows/main-stock-ubuntu.yml b/xo-indentlog/.github/workflows/main-stock-ubuntu.yml new file mode 100644 index 00000000..7871b808 --- /dev/null +++ b/xo-indentlog/.github/workflows/main-stock-ubuntu.yml @@ -0,0 +1,37 @@ +name: build on ubuntu base platform + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + # Customize CMake build type here + BUILD_TYPE: Release + +jobs: + build: + # This build won't be entirely reproducible, given ubuntu changes on github runners may + # introduce regressions. + # + runs-on: ubuntu-latest + + steps: + - name: checkout source + uses: actions/checkout@v3 + + - name: bootstrap xo-cmake + run: | + PREFIX=${{github.workspace}}/local + mkdir -p ${PREFIX} + echo "::group::xo-cmake configure" + cmake -B .build0 -S xo-cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} + echo "::group::xo-cmake build" + cmake --build .build0 + echo "::group::xo-cmake install" + cmake --install .build0 + + - name: print install path + run: | + tree ${{github.workspace}}/local diff --git a/xo-indentlog/.gitignore b/xo-indentlog/.gitignore new file mode 100644 index 00000000..656e515b --- /dev/null +++ b/xo-indentlog/.gitignore @@ -0,0 +1,2 @@ +result +.build* diff --git a/xo-indentlog/CMakeLists.txt b/xo-indentlog/CMakeLists.txt new file mode 100644 index 00000000..c76226c7 --- /dev/null +++ b/xo-indentlog/CMakeLists.txt @@ -0,0 +1,104 @@ +# xo/CMakeLists.txt + +cmake_minimum_required(VERSION 3.10) + +project(xo-submodule3 VERSION 1.0) + +# ---------------------------------------------------------------- +# global build settings + +# Adopting submodule builds directly into this cmake. +# Submodule builds will pickup dependent xo artifacts directly +# from sibling build dirs. +# (Contrast with a build that relies on install step). +# In particular, configure step in satellite projects +# needs to avoid using cmake find_package() on sibling xo projects: +# 1. .cmake support files +# fooConfig.cmake +# fooConfigVersion.cmake +# fooTargets.cmake +# won't have been installed +# 2. In any case, they point to final install location; +# we need build location +# +set(XO_SUBMODULE_BUILD True) + +# toplevel source directory; used only with XO_SUBMODULE_BUILD +set(XO_UMBRELLA_SOURCE_DIR ${CMAKE_SOURCE_DIR}) +set(XO_UMBRELLA_REPO_SUBDIR .) +# toplevel binary directory; used only with XO_SUBMODULE_BUILD +set(XO_UMBRELLA_BINARY_DIR ${CMAKE_BINARY_DIR}) + +set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/xo-cmake/cmake) + +# ---------------------------------------------------------------- +# unit test setup + +enable_testing() + +# ---------------------------------------------------------------- +# global c++ settings. + +enable_language(CXX) + +# temporary compiler flags here +set(PROJECT_CXX_FLAGS "") +add_definitions(${PROJECT_CXX_FLAGS}) + +if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 20) +endif() + +set(CMAKE_CXX_STANDARD_REQUIRED True) + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "") + +if(NOT CMAKE_INSTALL_RPATH) + set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib CACHE STRING "runpath for installed libraries/executables") +endif() + +message("-- CMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}") +message("-- CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") +message("-- CMAKE_INSTALL_RPATH=${CMAKE_INSTALL_RPATH}") + +# ---------------------------------------------------------------- +# xo satellite projects + +add_subdirectory(xo-cmake) +add_subdirectory(xo-indentlog) +#add_subdirectory(xo-refcnt) +#add_subdirectory(xo-subsys) +#add_subdirectory(xo-randomgen) +#add_subdirectory(xo-ordinaltree) +#add_subdirectory(xo-pyutil) +#add_subdirectory(xo-flatstring) +#add_subdirectory(xo-reflectutil) +#add_subdirectory(xo-reflect) +#add_subdirectory(xo-pyreflect) +#add_subdirectory(xo-ratio) +#add_subdirectory(xo-unit) +#add_subdirectory(xo-pyunit) +#add_subdirectory(xo-expression) +#add_subdirectory(xo-pyexpression) +#add_subdirectory(xo-tokenizer) +#add_subdirectory(xo-reader) +#add_subdirectory(xo-jit) +#add_subdirectory(xo-pyjit) +#add_subdirectory(xo-callback) +#add_subdirectory(xo-webutil) +#add_subdirectory(xo-pywebutil) +#add_subdirectory(xo-printjson) +#add_subdirectory(xo-pyprintjson) +#add_subdirectory(xo-reactor) +#add_subdirectory(xo-pyreactor) +#add_subdirectory(xo-websock) +#add_subdirectory(xo-pywebsock) +#add_subdirectory(xo-statistics) +#add_subdirectory(xo-distribution) +#add_subdirectory(xo-pydistribution) +#add_subdirectory(xo-simulator) +#add_subdirectory(xo-pysimulator) +#add_subdirectory(xo-process) +#add_subdirectory(xo-pyprocess) +#add_subdirectory(xo-kalmanfilter) +#add_subdirectory(xo-pykalmanfilter) diff --git a/xo-indentlog/README.md b/xo-indentlog/README.md new file mode 100644 index 00000000..09a6f261 --- /dev/null +++ b/xo-indentlog/README.md @@ -0,0 +1,85 @@ +# Introduction + +Local nix build for xo libraries. +Intended for local development work, with source in immediate subdirectories. + +## Features + +- native c++ +- deterministic simulation +- reflection +- python bindings + +## Getting Started + +### Cmake build + +If `nix` is available, you probably prefer the nix build. +Otherwise continue reading.. + +The cmake build has two phases, because it needs to bootstrap +generated `xo-cmake-config`, `xo-build` helpers. + +``` +$ cd xo +$ PREFIX=/path/to/say/usr/local +# phase 1 +$ cmake -B .build0 -S xo-cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} +$ cmake --build .build0 +$ cmake --install .build0 +# phase 2 +$ cmake -B .build -S . -DCMAKE_INSTALL_PREFIX=${PREFIX} +$ cmake --build .build +$ cmake --install .build +``` + +### Nix Build + +Nix build uses toplevel `default.nix`, +along with top-level `pkgs/xo-foo.nix` for each subproject `foo`. +It doesn't interact with toplevel `CMakeLists.txt`. + +``` +$ nix-build -A xo-userenv +``` + +This builds all xo subprojects, assembles sandbox under `./result`. + +``` +$ tree -L 1 ./result +./result +├── bin +│   ├── xo-build +│   ├── xo-cmake-config +│   └── xo-cmake-lcov-harness +└── share + ├── cmake + │   └── xo_macros + │   ├── code-coverage.cmake + │   ├── xo-project-macros.cmake + │   └── xo_cxx.cmake + ├── etc + │   └── xo + │   └── subsystem-list + └── xo-macros + ├── Doxyfile.in + ├── gen-ccov.in + └── xo-bootstrap-macros.cmake +``` + +## To add a new satellite repo + +1. check clone in clean state (all local changes committed or unwound) + +2. add satellite as remote + +``` +$ git remote add xo-foo git@github.com:Rconybea/xo-foo.git +$ git fetch xo-foo +``` + +3. checkout satellite repo + +``` +$ git subtree add --prefix=xo-foo main +``` diff --git a/xo-indentlog/default.nix b/xo-indentlog/default.nix new file mode 100644 index 00000000..5b619074 --- /dev/null +++ b/xo-indentlog/default.nix @@ -0,0 +1,94 @@ +#{ pkgs ? import { overlays = [ (final: prev: { llvmPackages = prev.llvmPackages_17; }) ]; } }: +#pkgs.mkShell { +# buildInputs = [ pkgs.coreutils ]; +#} + + +{ + nixpkgs-path ? ../nixpkgs, + +# pkgs ? import (fetchTarball { +# # 24.05-darwin works on macos, clang17, llvm 18 (copying from xo-nix2) +# url = "https://github.com/NixOS/nixpkgs/archive/dd868b7bd4d1407d607da0d1d9c5eca89132e2f7.tar.gz"; +# }), +} : + +let + # this approach (overlays) is effective, but has super wide cross-section, + # since absolutely everything has to be rebuilt from source + # + + llvm-overlay = self: super: { + # use 'super' when you want to override the terms of a package. + # use 'self' when pointing to an existing package + + llvmPackages = super.llvmPackages_18; + }; + + xo-overlay = self: super: + let + # Choose the LLVM version you want + llvmPackages = self.llvmPackages_18; + in + + let + # Rebuild stdenv to use that LLVM version + customStdenv = super.overrideCC super.stdenv llvmPackages.clang; + in + + { + xo-cmake = self.callPackage pkgs/xo-cmake.nix {}; + xo-indentlog = self.callPackage pkgs/xo-indentlog.nix {}; +# xo-refcnt = self.callPackage pkgs/xo-refcnt.nix {}; +# xo-subsys = self.callPackage pkgs/xo-subsys.nix {}; +# xo-randomgen = self.callPackage pkgs/xo-randomgen.nix {}; +# xo-ordinaltree = self.callPackage pkgs/xo-ordinaltree.nix {}; +# xo-pyutil = self.callPackage pkgs/xo-pyutil.nix {}; +# xo-flatstring = self.callPackage pkgs/xo-flatstring.nix {}; +# xo-reflectutil = self.callPackage pkgs/xo-reflectutil.nix {}; +# xo-reflect = self.callPackage pkgs/xo-reflect.nix {}; +# xo-pyreflect = self.callPackage pkgs/xo-pyreflect.nix {}; +# xo-ratio = self.callPackage pkgs/xo-ratio.nix {}; +# xo-unit = self.callPackage pkgs/xo-unit.nix {}; +# xo-pyunit = self.callPackage pkgs/xo-pyunit.nix {}; +# xo-expression = self.callPackage pkgs/xo-expression.nix {}; +# xo-pyexpression = self.callPackage pkgs/xo-pyexpression.nix {}; +# xo-tokenizer = self.callPackage pkgs/xo-tokenizer.nix {}; +# xo-reader = self.callPackage pkgs/xo-reader.nix {}; +# xo-jit = self.callPackage pkgs/xo-jit.nix { stdenv = customStdenv; +# clang = llvmPackages.clang; +# llvm = llvmPackages.llvm; }; +# xo-pyjit = self.callPackage pkgs/xo-pyjit.nix {}; +# xo-callback = self.callPackage pkgs/xo-callback.nix {}; +# xo-webutil = self.callPackage pkgs/xo-webutil.nix {}; +# xo-pywebutil = self.callPackage pkgs/xo-pywebutil.nix {}; +# xo-printjson = self.callPackage pkgs/xo-printjson.nix {}; +# xo-pyprintjson = self.callPackage pkgs/xo-pyprintjson.nix {}; +# xo-reactor = self.callPackage pkgs/xo-reactor.nix {}; +# xo-pyreactor = self.callPackage pkgs/xo-pyreactor.nix {}; +# xo-websock = self.callPackage pkgs/xo-websock.nix {}; +# xo-pywebsock = self.callPackage pkgs/xo-pywebsock.nix {}; +# xo-statistics = self.callPackage pkgs/xo-statistics.nix {}; +# xo-distribution = self.callPackage pkgs/xo-distribution.nix {}; +# xo-pydistribution = self.callPackage pkgs/xo-pydistribution.nix {}; +# xo-simulator = self.callPackage pkgs/xo-simulator.nix {}; +# xo-pysimulator = self.callPackage pkgs/xo-pysimulator.nix {}; +# xo-process = self.callPackage pkgs/xo-process.nix {}; +# xo-pyprocess = self.callPackage pkgs/xo-pyprocess.nix {}; +# xo-kalmanfilter = self.callPackage pkgs/xo-kalmanfilter.nix {}; +# xo-pykalmanfilter = self.callPackage pkgs/xo-pykalmanfilter.nix {}; +# + xo-userenv = self.callPackage pkgs/xo-userenv.nix {}; +# xo-userenv-slow = self.callPackage pkgs/xo-userenv-slow.nix {}; + }; + +in +let + pkgs = import nixpkgs-path { + overlays = [ +# llvm-overlay + xo-overlay + ]; + }; +in +pkgs diff --git a/xo-indentlog/pkgs/xo-cmake.nix b/xo-indentlog/pkgs/xo-cmake.nix new file mode 100644 index 00000000..69c32bab --- /dev/null +++ b/xo-indentlog/pkgs/xo-cmake.nix @@ -0,0 +1,15 @@ +{ + # dependencies + + stdenv, + cmake +} : + +stdenv.mkDerivation (finalattrs: + { + name = "xo-cmake"; + + src = ../xo-cmake; + + nativeBuildInputs = [ cmake ]; + }) diff --git a/xo-indentlog/pkgs/xo-indentlog.nix b/xo-indentlog/pkgs/xo-indentlog.nix new file mode 100644 index 00000000..12255020 --- /dev/null +++ b/xo-indentlog/pkgs/xo-indentlog.nix @@ -0,0 +1,18 @@ +{ + # dependencies + stdenv, cmake, catch2, + + xo-cmake, +} : + +stdenv.mkDerivation (finalattrs: + { + name = "xo-indentlog"; + version = "1.0"; + + src = ../xo-indentlog; + + cmakeFlags = ["-DCMAKE_MODULE_PATH=${xo-cmake}/share/cmake"]; + doCheck = true; + nativeBuildInputs = [ cmake catch2 xo-cmake ]; + }) diff --git a/xo-indentlog/pkgs/xo-userenv.nix b/xo-indentlog/pkgs/xo-userenv.nix new file mode 100644 index 00000000..b70bb3f6 --- /dev/null +++ b/xo-indentlog/pkgs/xo-userenv.nix @@ -0,0 +1,99 @@ +# builds environment with all xo packages, +# using combined output directory for each. +# +# parallels github actions build on stock ubuntu, +# except that we use nixpkgs for toolchain +# +# For xo development, probably prefer xo-userenv.nix instead of this xo-userenv-slow.nix: +# 1. xo-userenv.nix allows parallel build +# 2. xo-userenv.nix only rebuilds xo packages that have changed + +{ + # nixpkgs dependencies + buildEnv, + stdenv, + cmake, + catch2, + eigen, + libwebsockets, + jsoncpp, + doxygen, + sphinx, + python3Packages, + + # xo dependencies + xo-cmake, + xo-indentlog, +# xo-subsys, +# xo-refcnt, +# xo-randomgen, +# xo-ordinaltree, +# xo-flatstring, +# xo-reflectutil, +# xo-ratio, +# xo-unit, +# xo-pyunit, +# xo-pyutil, +# xo-reflect, +# xo-pyreflect, +# xo-printjson, +# xo-pyprintjson, +# xo-callback, +# xo-webutil, +# xo-pywebutil, +# xo-reactor, +# xo-pyreactor, +# xo-simulator, +# xo-pysimulator, xo-distribution, xo-pydistribution, xo-process, xo-pyprocess, xo-statistics, xo-kalmanfilter, +# xo-pykalmanfilter, xo-websock, xo-pywebsock, xo-tokenizer, +# xo-expression, xo-pyexpression, xo-reader, +# xo-jit, +# xo-pyjit + + # other args + + # someconfigurationoption ? false +} : + +buildEnv { + name = "xo-userenv"; + paths = [ xo-cmake + xo-indentlog +# xo-refcnt +# xo-subsys +# xo-randomgen +# xo-ordinaltree +# xo-pyutil +# xo-flatstring +# xo-reflectutil +# xo-reflect +# xo-pyreflect +# xo-ratio +# xo-unit +# xo-pyunit +# xo-expression +# xo-pyexpression +# xo-tokenizer +# xo-reader +# xo-jit +# xo-pyjit +# xo-callback +# xo-webutil +# xo-pywebutil +# xo-printjson +# xo-pyprintjson +# xo-reactor +# xo-pyreactor +# xo-websock +# xo-pywebsock +# xo-statistics +# xo-distribution +# xo-pydistribution +# xo-simulator +# xo-pysimulator +# xo-process +# xo-pyprocess +# xo-kalmanfilter +# xo-pykalmanfilter + ]; +} diff --git a/xo-indentlog/xo-cmake/.github/workflows/xo-cpp-main.yml b/xo-indentlog/xo-cmake/.github/workflows/xo-cpp-main.yml new file mode 100644 index 00000000..a792ec7d --- /dev/null +++ b/xo-indentlog/xo-cmake/.github/workflows/xo-cpp-main.yml @@ -0,0 +1,74 @@ +name: XO cmake xo-cpp-builder + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build: + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. + # You can convert this to a matrix build if you need cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ubuntu-latest + + container: + # custom docker image. see github.com:rconybea/docker-xo-builder for definition + image: ghcr.io/rconybea/docker-xo-builder:v1 + + steps: + - name: xo-cmake + run: | + # treat github.com as known host to prevent shtoopid SSL errors + mkdir -p ~/.ssh + ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts + cat ~/.ssh/known_hosts + + git config --global http.sslVerify false + + XO_NAME=xo-cmake + XO_SRC=repo/${XO_NAME} + XO_BUILDDIR=${{github.workspace}}/build_${XO_NAME} + PREFIX=${{github.workspace}}/local + + XO_REPO=https://github.com/rconybea/xo-cmake.git + + mkdir -p ${XO_SRC} + mkdir -p ${XO_BUILDDIR} + + echo "::group::clone ${XO_NAME}" + export GIT_SSH_COMMAND='ssh -o StrictHostKeyChecking=no' + export GIT_SSL_NOVERIFY=true + git clone ${XO_REPO} ${XO_SRC} + echo "::endgroup" + + echo "::group::configure ${XO_NAME}" + cmake -B ${XO_BUILDDIR} -DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${XO_SRC} + echo "::endgroup" + + echo "::group::compile ${XO_NAME}" + cmake --build ${XO_BUILDDIR} -j + echo "::endgroup" + + echo "::group::local install ${XO_NAME}" + cmake --install ${XO_BUILDDIR} + echo "::endgroup" + + echo "::group::local dir tree" + tree ${PREFIX} + echo "::endgroup" + + echo "::group::verify" + ls -l ${PREFIX}/bin/xo-cmake-config + ${PREFIX}/bin/xo-cmake-config --help + echo "$(${PREFIX}/bin/xo-cmake-config --lcov-exe)" + echo "$(${PREFIX}/bin/xo-cmake-config --genhtml-exe)" + echo "$(${PREFIX}/bin/xo-cmake-config --lcov-harness-exe)" + echo "$(${PREFIX}/bin/xo-cmake-config --gen-ccov-template)" + echo "$(${PREFIX}/bin/xo-cmake-config --cmake-module-path)" + echo "::endgroup" diff --git a/xo-indentlog/xo-cmake/.gitignore b/xo-indentlog/xo-cmake/.gitignore new file mode 100644 index 00000000..04e2da49 --- /dev/null +++ b/xo-indentlog/xo-cmake/.gitignore @@ -0,0 +1,3 @@ +.projectile +.build +compile_commands.json diff --git a/xo-indentlog/xo-cmake/CMakeLists.txt b/xo-indentlog/xo-cmake/CMakeLists.txt new file mode 100644 index 00000000..14226afa --- /dev/null +++ b/xo-indentlog/xo-cmake/CMakeLists.txt @@ -0,0 +1,67 @@ +cmake_minimum_required(VERSION 3.10) + +project(xo_macros VERSION 1.0) + +# if any are useful for this project.. +include (GNUInstallDirs) + +set(XO_PROJECT_NAME xo_macros) + +# LCOV_EXECUTABLE,GENHTML_EXECUTABLE: needed by xo-cmake-lcov-harness.in +find_program(LCOV_EXECUTABLE NAMES lcov) +find_program(GENHTML_EXECUTABLE NAMES genhtml) + +configure_file( + ${PROJECT_SOURCE_DIR}/bin/xo-cmake-lcov-harness.in + ${PROJECT_BINARY_DIR}/xo-cmake-lcov-harness + @ONLY + ) + +configure_file( + ${PROJECT_SOURCE_DIR}/bin/xo-cmake-config.in + ${PROJECT_BINARY_DIR}/xo-cmake-config + @ONLY + ) + +configure_file( + ${PROJECT_SOURCE_DIR}/bin/xo-build.in + ${PROJECT_BINARY_DIR}/xo-build + @ONLY + ) + +install( + FILES + "cmake/xo_macros/xo-project-macros.cmake" + "cmake/xo_macros/xo_cxx.cmake" + "cmake/xo_macros/code-coverage.cmake" + PERMISSIONS OWNER_READ GROUP_READ WORLD_READ + DESTINATION ${CMAKE_INSTALL_DATADIR}/cmake/xo_macros +) + +install( + FILES + "${PROJECT_BINARY_DIR}/xo-cmake-lcov-harness" + "${PROJECT_BINARY_DIR}/xo-cmake-config" + "${PROJECT_BINARY_DIR}/xo-build" + PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + DESTINATION ${CMAKE_INSTALL_BINDIR} +) + +install( + FILES + "etc/xo/subsystem-list" + PERMISSIONS OWNER_READ GROUP_READ WORLD_READ + DESTINATION ${CMAKE_INSTALL_DATADIR}/etc/xo +) + +# The cmake template gen-ccov.in should be expanded in downstream project; +# to pickup downstream project's PROJECT_SOURCE_DIR / PROJECT_BINARY_DIR +# +install( + FILES + "share/xo-macros/gen-ccov.in" + "share/xo-macros/Doxyfile.in" + "share/xo-macros/xo-bootstrap-macros.cmake" + PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + DESTINATION ${CMAKE_INSTALL_DATADIR}/xo-macros +) diff --git a/xo-indentlog/xo-cmake/FAQ b/xo-indentlog/xo-cmake/FAQ new file mode 100644 index 00000000..e30a679f --- /dev/null +++ b/xo-indentlog/xo-cmake/FAQ @@ -0,0 +1,120 @@ +# Unit test build can't find library: + +Missing dependency at link time + +``` +set(SELF_EXE mumble) +set(SELF_SRCS mumble.cpp) + +xo_add_executable(${SELF_EXE} ${SELF_SRCS}) +xo_self_dependency(${SELF_EXE} xo_foo) +``` + +and build fails with `cannot find -lxo_bar`. + +Possible causes: + +1. missing cmake export for a dependency of `xo_foo`. + Check `xo_foo/cmake/xo_fooConfig.cmake.in`: + + If `xo_foo` depends on `xo_bar`, then cmake export + needs to have `find_dependency(xo_bar)` + +``` +@PACKAGE_INIT@ + +include(CMakeFindDependencyMacro) +find_dependency(xo_bar) +find_dependency(xo_maybemoar) + +include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") +check_required_components("@PROJECT_NAME@") +``` + +# Howto introduce sphinx documentation to an XO project + +REMINDER: must re-run `cmake` after introducing skeleton, since build copies files from docs/ to .build directory + +Minimal skeleton for docs/ directory: + +``` +xo-foo ++- docs + +- CMakeLists.txt + +- conf.py + +- _static + +- index.rst +``` + +CMakeLists.txt: +``` +# xo-foo/docs/CMakeLists.txt + +xo_doxygen_collect_deps() +xo_docdir_doxygen_config() +xo_docdir_sphinx_config( + index.rst +) +``` + +conf.py: +``` +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = 'xo jit documentation' +copyright = '2024, Roland Conybeare' +author = 'Roland Conybeare' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +#extensions = [] +extensions = [ "breathe", + "sphinx.ext.mathjax", # inline math + "sphinx.ext.autodoc", # generate info from docstrings + "sphinxcontrib.ditaa", # diagrams-through-ascii-art + "sphinxcontrib.plantuml" # text -> uml diagrams + ] + +# note: breathe requires doxygen xml output -> must have GENERATE_XML = YES in Doxyfile.in +# match project name in Doxyfile.in +breathe_default_project = "xodoxxml" + +templates_path = ['_templates'] +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + +pygments_style = 'sphinx' + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +#html_theme = 'alabaster' +html_theme = 'sphinx_rtd_theme' +html_static_path = ['_static'] +html_favicon = '_static/img/favicon.ico' +``` + +index.rst: +``` +xo-foo documentation +==================== + +text here + +.. toctree:: + :maxdepth: 2 + :caption: xo-foo contents + + genindex + search +``` + +_static: + +copy from xo-unit/docs/_static. Just need .ico diff --git a/xo-indentlog/xo-cmake/README.md b/xo-indentlog/xo-cmake/README.md new file mode 100644 index 00000000..8ccf76bb --- /dev/null +++ b/xo-indentlog/xo-cmake/README.md @@ -0,0 +1,61 @@ +# XO cmake modules + +Collects cmake macros to be shared across XO projects (e.g. indentlog, reflect, kalman, ..) + +## Features + +- support for both manyrepo and monorepo projects +- support for generating cmake `xxxConfig.cmake` files, so cmake `find_package()` works reliably +- support for header-only libraries +- support for pybind11 libraries +- documentation generation using doxygen + breathe + sphinx +- code coverage using ccov + lcov + +## Getting Started + +### copy repo + +``` +$ git clone https://github.com:rconybea/xo-cmake.git +``` + +### configure + install +``` +$ cd xo-cmake +$ cmake -DCMAKE_INSTALL_PREFIX=/usr/local -B .build -S . # ..or desired prefix +$ cmake --install .build +``` + +## use from a cmake project + +In some project `foo`: +``` +$ cd foo +$ mkdir cmake +$ cp $PREFIX/share/xo-macros/xo-bootstrap-macros.cmake cmake/ +``` + +`xo-bootstrap-macros-cmake` has two vital jobs: +1. set `XO_CMAKE_CONFIG_EXECUTABLE` (locate `xo-cmake-config`) +2. set `CMAKE_MODULE_PATH` (obtained from `xo-cmake-config --cmake-module-path`) + +then in `foo/CMakeLists.txt`: +``` +include(cmake/xo-bootstrap-macros.cmake) + +xo_cxx_toplevel_options3() +``` + +Now as long as `$PREFIX/bin` is in `PATH`: +``` +$ cd mybuild +$ cmake path/to/foo/source +``` + +### or set `XO_CMAKE_CONFIG_EXECUTABLE` and `CMAKE_MODULE_PATH` + +In some project `foo`: +``` +$ cd mybuild +$ cmake -DXO_CMAKE_CONFIG_EXECUTABLE=xo-cmake-config -DCMAKE_MODULE_PATH=$(xo-cmake-config --cmake-module-path) path/to/foo/source +``` diff --git a/xo-indentlog/xo-cmake/bin/xo-build.in b/xo-indentlog/xo-cmake/bin/xo-build.in new file mode 100644 index 00000000..194ce3df --- /dev/null +++ b/xo-indentlog/xo-cmake/bin/xo-build.in @@ -0,0 +1,220 @@ +#!/usr/bin/env bash + +usage() { + cat < 0 ]]; do + case "$1" in + -u | --usage) + cmd='usage' + ;; + -h | --help) + cmd='help' + ;; + -n) + noop_flag=1 + ;; + -S) + shift + pathtosource=$1 + ;; + -S=*) + pathtosource="${1#*=}" + ;; + -B) + shift + pathtobuild=$1 + ;; + -B=*) + pathtobuild="${1#*=}" + ;; + --list) + cmd='list' + ;; + --xoname=*) + xoname="${1#*=}" + ;; + --repo) + repo_flag=1 + ;; + --clone) + clone_flag=1 + ;; + --configure|--config) + configure_flag=1 + ;; + --build) + build_flag=1 + ;; + --install) + install_flag=1 + ;; + xo-*) + xoname="$1" + ;; + *) + usage + exit 1 + ;; + esac + + shift +done + +echo xoname=$xoname pathtosource=$pathtosource pathtobuild=$pathtobuild + +if [[ -z "$pathtosource" ]]; then + pathtosource=$xoname +fi + +if [[ -z "$pathtobuild" ]]; then + pathtobuild=$xoname/.build +fi + +SUBSYSTEMLIST_FILE=@CMAKE_INSTALL_FULL_DATADIR@/etc/xo/subsystem-list + +subsystem_list() { + cat ${SUBSYSTEMLIST_FILE} +} + +XO_REPO_STEM="https://github.com/Rconybea" + +repo() { + xoname=$1 + + case "$xoname" in + xo-indentlog) + echo "${XO_REPO_STEM}/indentlog.git" + ;; + xo-refcnt) + echo "${XO_REPO_STEM}/refcnt.git" + ;; + xo-subsys) + echo "${XO_REPO_STEM}/subsys.git" + ;; + xo-reflect) + echo "${XO_REPO_STEM}/reflect.git" + ;; + *) + if grep -q $1 ${SUBSYSTEMLIST_FILE}; then + echo "${XO_REPO_STEM}/${1}.git" + else + >&2 echo "$0: unknown xo component [${xoname}]" + return 1 + fi + esac + + return 0 +} + +if [[ $cmd == 'usage' ]]; then + echo -n "usage: " + usage + exit 0 +elif [[ $cmd == 'help' ]]; then + echo -n "help; " + help + exit 0 +fi + +set -e + +if [[ $cmd == 'list' ]]; then + subsystem_list +fi + +if [[ $repo_flag -eq 1 ]]; then + if [[ -n "$xoname" ]]; then + repo $xoname + fi +fi + +if [[ $clone_flag -eq 1 ]]; then + if [[ -n "$xoname" ]]; then + url=$(repo $xoname) + + cmd="git clone $url" + + if [[ $noop_flag -eq 1 ]]; then + echo $cmd + else + $cmd + fi + fi +fi + +if [[ $configure_flag -eq 1 ]]; then + if [[ -n "$xoname" ]]; then + cmd="cmake -DCMAKE_INSTALL_PREFIX=@CMAKE_INSTALL_PREFIX@ -S $pathtosource -B $pathtobuild" + + if [[ $noop_flag -eq 1 ]]; then + echo $cmd + else + $cmd + fi + fi +fi + +if [[ $build_flag -eq 1 ]]; then + if [[ -n "$xoname" ]]; then + cmd="cmake --build $pathtobuild -j" + + if [[ $noop_flag -eq 1 ]]; then + echo $cmd + else + $cmd + fi + fi +fi + +if [[ $install_flag -eq 1 ]]; then + if [[ -n "$xoname" ]]; then + cmd="cmake --install $pathtobuild" + + if [[ $noop_flag -eq 1 ]]; then + echo $cmd + else + $cmd + fi + fi +fi diff --git a/xo-indentlog/xo-cmake/bin/xo-cmake-config.in b/xo-indentlog/xo-cmake/bin/xo-cmake-config.in new file mode 100755 index 00000000..bbea1361 --- /dev/null +++ b/xo-indentlog/xo-cmake/bin/xo-cmake-config.in @@ -0,0 +1,86 @@ +#!/usr/bin/env bash + +usage() { + echo "$0 [-u|--usage|-h|--help|--lcov-exe|--genhtml-exe|--lcov-harness-exe|--gen-ccov-template|--cmake-module-path|--subsystem-list]" 1>&2 +} + +help() { + usage + + cat < 0 ]]; do + case "$1" in + -u | --usage) + cmd='usage' + ;; + -h | --help) + cmd='help' + ;; + --cmake-module-path) + cmd='cmake_module_path' + ;; + --lcov-exe) + cmd='lcov_exe' + ;; + --genhtml-exe) + cmd='genhtml_exe' + ;; + --lcov-harness-exe) + cmd='lcov_harness_exe' + ;; + --gen-ccov-template) + cmd='gen_ccov_template' + ;; + --doxygen-template) + cmd='doxygen_template' + ;; + --subsystem-list) + cmd='subsystem_list' + ;; + *) + usage + exit 1 + ;; + esac + + shift +done + +if [[ $cmd == 'usage' ]]; then + echo -n "usage: " + usage +elif [[ $cmd == 'help' ]]; then + echo -n "help: " + help +elif [[ $cmd == 'cmake_module_path' ]]; then + echo -n @CMAKE_INSTALL_FULL_DATADIR@/cmake +elif [[ $cmd == 'lcov_exe' ]]; then + echo -n @LCOV_EXECUTABLE@ +elif [[ $cmd == 'genhtml_exe' ]]; then + echo -n @GENHTML_EXECUTABLE@ +elif [[ $cmd == 'lcov_harness_exe' ]]; then + echo -n @CMAKE_INSTALL_FULL_BINDIR@/xo-cmake-lcov-harness +elif [[ $cmd == 'gen_ccov_template' ]]; then + echo -n @CMAKE_INSTALL_FULL_DATADIR@/xo-macros/gen-ccov.in +elif [[ $cmd == 'doxygen_template' ]]; then + echo -n @CMAKE_INSTALL_FULL_DATADIR@/xo-macros/Doxyfile.in +elif [[ $cmd == 'subsystem_list' ]]; then + echo -n @CMAKE_INSTALL_FULL_DATADIR@/etc/xo/subsystem-list +fi diff --git a/xo-indentlog/xo-cmake/bin/xo-cmake-lcov-harness.in b/xo-indentlog/xo-cmake/bin/xo-cmake-lcov-harness.in new file mode 100755 index 00000000..414b950a --- /dev/null +++ b/xo-indentlog/xo-cmake/bin/xo-cmake-lcov-harness.in @@ -0,0 +1,121 @@ +#!/usr/bin/env bash + +srcdir=$1 +builddir=$2 +outputstem=$3 # optional +lcov=$4 # optional +genhtml=$5 # optional + +if [[ -z "${srcdir}" ]]; then + echo "xo-cmake-lcov-harness: expected non-empty srcdir" + exit 1 +fi + +if [[ -z "${builddir}" ]]; then + echo "xo-cmake-lcov-harness: expected non-empty builddir" + exit 1 +fi + +if [[ -z ${outputstem} ]]; then + outputstem=$builddir/ccov/out +fi + +if [[ -z ${lcov} ]]; then + lcov=@LCOV_EXECUTABLE@ + if [[ $lcov == "LCOV_EXECUTABLE-NOTFOUND" ]]; then + echo "xo-cmake-lcov-harness: lcov executable not found during xo-cmake build/install" + exit 1 + fi +fi + +if [[ -z ${genhtml} ]]; then + genhtml=@GENHTML_EXECUTABLE@ + if [[ $genhtml == "GENHTML_EXECUTABLE-NOTFOUND" ]]; then + echo "xo-cmake-lcov-harness: genhtml executable not found during xo-cmake build/install" + exit 1 + fi +fi + +mkdir -p $builddir/ccov + +# directory stems for location of {.gcda, gcno} coverage information, +# +# if we have source tree: +# +# ${srcdir} +# +- foo +# | \- foo.cpp +# \- bar +# \- quux +# +- quux.cpp +# \- quux_main.cpp +# +# then we expect build tree: +# +# ${builddir} +# +- foo +# | \- CMakeFiles +# | \- foo_target.dir +# | +- foo.cpp.gcda +# | \- foo.cpp.gcno +# +- bar +# \- quux +# \- CMakeFiles +# \- target4quux.dir +# +- quux.cpp.gcda +# +- quux.cpp.gcno +# +- quux_main.cpp.gcda +# \- quux_main.cpp.gcno +# +# in which case will have cmd_body: +# +# ${primarydirs} +# ./foo/CMakeFiles/foo_target.dir +# ./bar/quux/CMakeFiles/target4quux.dir +# +# here foo_target, quux_target are whatever build is using for corresponding cmake target names. +# +# We want to invoke lcov like: +# +# lcov --capture \ +# --output ${builddir}/ccov \ +# --exclude /utest/ \ +# --base-directory ${srcdir}/foo --directory ${builddir}/foo/CMakeFiles/foo_target.dir \ +# --base-directory ${srcdir}/bar/quux --directory ${builddir}/bar/quux/CMakeFiles/target4quux.dir +# +primarydirs=$(cd ${builddir} && find -name '*.gcno' \ + | xargs --replace=xx dirname xx \ + | uniq \ + | sed -e 's:^\./::') + +#echo "primarydirs=${primarydirs}" + +cmd="${lcov} --output ${outputstem}.info --capture --ignore-errors source" + +for bdir in ${primarydirs}; do + sdir=$(dirname $(dirname ${bdir})) + + cmd="${cmd} --base-directory ${srcdir}/${sdir} --directory ${builddir}/${bdir}" +done + +#echo cmd=${cmd} + +set -x + +# capture +${cmd} + +# keep only files with paths under source tree +# (don't want coverage for external libraries such as libstdc++ etc) +${lcov} --extract ${outputstem}.info "${srcdir}/*" --output ${outputstem}2.info + +# remove unit test dirs +# (we're interested in coverage of our installed code, not of the unit tests that exercise it) +${lcov} --remove ${outputstem}2.info '*/utest/*' --output ${outputstem}3.info + +# generate .html tree +mkdir -p ${builddir}/ccov/html +${genhtml} --ignore-errors source --show-details --prefix ${srcdir} --output-directory ${builddir}/ccov/html ${outputstem}3.info + +# also send report to stdout +${lcov} --list ${outputstem}3.info diff --git a/xo-indentlog/xo-cmake/cmake/xo_macros/code-coverage.cmake b/xo-indentlog/xo-cmake/cmake/xo_macros/code-coverage.cmake new file mode 100644 index 00000000..b6b36064 --- /dev/null +++ b/xo-indentlog/xo-cmake/cmake/xo_macros/code-coverage.cmake @@ -0,0 +1,678 @@ +# +# Copyright (C) 2018-2020 by George Cave - gcave@stablecoder.ca +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +# USAGE: To enable any code coverage instrumentation/targets, the single CMake +# option of `CODE_COVERAGE` needs to be set to 'ON', either by GUI, ccmake, or +# on the command line. +# +# From this point, there are two primary methods for adding instrumentation to +# targets: +# +# 1 - A blanket instrumentation by calling `add_code_coverage()`, where +# all targets in that directory and all subdirectories are automatically +# instrumented. +# +# 2 - Per-target instrumentation by calling +# `target_code_coverage()`, where the target is given and thus only +# that target is instrumented. This applies to both libraries and executables. +# +# To add coverage targets, such as calling `make ccov` to generate the actual +# coverage information for perusal or consumption, call +# `target_code_coverage()` on an *executable* target. +# +# Example 1: All targets instrumented +# +# In this case, the coverage information reported will will be that of the +# `theLib` library target and `theExe` executable. +# +# 1a: Via global command +# +# ~~~ +# add_code_coverage() # Adds instrumentation to all targets +# +# add_library(theLib lib.cpp) +# +# add_executable(theExe main.cpp) +# target_link_libraries(theExe PRIVATE theLib) +# target_code_coverage(theExe) # As an executable target, adds the 'ccov-theExe' target +# # (instrumentation already added via global anyways) +# # for generating code coverage reports. +# ~~~ +# +# 1b: Via target commands +# +# ~~~ +# add_library(theLib lib.cpp) +# target_code_coverage(theLib) # As a library target, adds coverage instrumentation but no targets. +# +# add_executable(theExe main.cpp) +# target_link_libraries(theExe PRIVATE theLib) +# target_code_coverage(theExe) # As an executable target, adds the 'ccov-theExe' target and instrumentation for generating code coverage reports. +# ~~~ +# +# Example 2: Target instrumented, but with regex pattern of files to be excluded +# from report +# +# ~~~ +# add_executable(theExe main.cpp non_covered.cpp) +# target_code_coverage(theExe EXCLUDE non_covered.cpp test/*) # As an executable target, the reports will exclude the non-covered.cpp file, and any files in a test/ folder. +# ~~~ +# +# Example 3: Target added to the 'ccov' and 'ccov-all' targets +# +# ~~~ +# add_code_coverage_all_targets(EXCLUDE test/*) # Adds the 'ccov-all' target set and sets it to exclude all files in test/ folders. +# +# add_executable(theExe main.cpp non_covered.cpp) +# target_code_coverage(theExe AUTO ALL EXCLUDE non_covered.cpp test/*) # As an executable target, adds to the 'ccov' and ccov-all' targets, and the reports will exclude the non-covered.cpp file, and any files in a test/ folder. +# ~~~ + +# Options +option( + CODE_COVERAGE + "Builds targets with code coverage instrumentation. (Requires GCC or Clang)" + OFF) + +# Programs +find_program(LLVM_COV_PATH llvm-cov) +find_program(LLVM_PROFDATA_PATH llvm-profdata) +find_program(LCOV_PATH lcov) +find_program(GENHTML_PATH genhtml) +# Hide behind the 'advanced' mode flag for GUI/ccmake +mark_as_advanced(FORCE LLVM_COV_PATH LLVM_PROFDATA_PATH LCOV_PATH GENHTML_PATH) + +# Variables +set(CMAKE_COVERAGE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/ccov) +set_property(GLOBAL PROPERTY JOB_POOLS ccov_serial_pool=1) + +# Common initialization/checks +if(CODE_COVERAGE AND NOT CODE_COVERAGE_ADDED) + set(CODE_COVERAGE_ADDED ON) + + # Common Targets + add_custom_target( + ccov-preprocessing + COMMAND ${CMAKE_COMMAND} -E make_directory + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY} + DEPENDS ccov-clean) + + if(CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang" + OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?[Cc]lang") + # Messages + message(STATUS "Building with llvm Code Coverage Tools") + + if(NOT LLVM_COV_PATH) + message(FATAL_ERROR "llvm-cov not found! Aborting.") + else() + # Version number checking for 'EXCLUDE' compatibility + execute_process(COMMAND ${LLVM_COV_PATH} --version + OUTPUT_VARIABLE LLVM_COV_VERSION_CALL_OUTPUT) + string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" LLVM_COV_VERSION + ${LLVM_COV_VERSION_CALL_OUTPUT}) + + if(LLVM_COV_VERSION VERSION_LESS "7.0.0") + message( + WARNING + "target_code_coverage()/add_code_coverage_all_targets() 'EXCLUDE' option only available on llvm-cov >= 7.0.0" + ) + endif() + endif() + + # Targets + if(${CMAKE_VERSION} VERSION_LESS "3.17.0") + add_custom_target( + ccov-clean + COMMAND ${CMAKE_COMMAND} -E remove -f + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list + COMMAND ${CMAKE_COMMAND} -E remove -f + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/profraw.list) + else() + add_custom_target( + ccov-clean + COMMAND ${CMAKE_COMMAND} -E rm -f + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list + COMMAND ${CMAKE_COMMAND} -E rm -f + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/profraw.list) + endif() + + # Used to get the shared object file list before doing the main all- + # processing + add_custom_target( + ccov-libs + COMMAND ; + COMMENT "libs ready for coverage report.") + + elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES + "GNU") + # Messages + message(STATUS "Building with lcov Code Coverage Tools") + + if(CMAKE_BUILD_TYPE) + string(TOUPPER ${CMAKE_BUILD_TYPE} upper_build_type) + if(NOT ${upper_build_type} STREQUAL "DEBUG") + message( + WARNING + "Code coverage results with an optimized (non-Debug) build may be misleading" + ) + endif() + else() + message( + WARNING + "Code coverage results with an optimized (non-Debug) build may be misleading" + ) + endif() + if(NOT LCOV_PATH) + message(FATAL_ERROR "lcov not found! Aborting...") + endif() + if(NOT GENHTML_PATH) + message(FATAL_ERROR "genhtml not found! Aborting...") + endif() + + # Targets + add_custom_target(ccov-clean COMMAND ${LCOV_PATH} --directory + ${CMAKE_BINARY_DIR} --zerocounters) + + else() + message(FATAL_ERROR "Code coverage requires Clang or GCC. Aborting.") + endif() +endif() + +# Adds code coverage instrumentation to a library, or instrumentation/targets +# for an executable target. +# ~~~ +# EXECUTABLE ADDED TARGETS: +# GCOV/LCOV: +# ccov : Generates HTML code coverage report for every target added with 'AUTO' parameter. +# ccov-${TARGET_NAME} : Generates HTML code coverage report for the associated named target. +# ccov-all : Generates HTML code coverage report, merging every target added with 'ALL' parameter into a single detailed report. +# +# LLVM-COV: +# ccov : Generates HTML code coverage report for every target added with 'AUTO' parameter. +# ccov-report : Generates HTML code coverage report for every target added with 'AUTO' parameter. +# ccov-${TARGET_NAME} : Generates HTML code coverage report. +# ccov-report-${TARGET_NAME} : Prints to command line summary per-file coverage information. +# ccov-export-${TARGET_NAME} : Exports the coverage report to a JSON file. +# ccov-show-${TARGET_NAME} : Prints to command line detailed per-line coverage information. +# ccov-all : Generates HTML code coverage report, merging every target added with 'ALL' parameter into a single detailed report. +# ccov-all-report : Prints summary per-file coverage information for every target added with ALL' parameter to the command line. +# ccov-all-export : Exports the coverage report to a JSON file. +# +# Required: +# TARGET_NAME - Name of the target to generate code coverage for. +# Optional: +# PUBLIC - Sets the visibility for added compile options to targets to PUBLIC instead of the default of PRIVATE. +# INTERFACE - Sets the visibility for added compile options to targets to INTERFACE instead of the default of PRIVATE. +# PLAIN - Do not set any target visibility (backward compatibility with old cmake projects) +# AUTO - Adds the target to the 'ccov' target so that it can be run in a batch with others easily. Effective on executable targets. +# ALL - Adds the target to the 'ccov-all' and 'ccov-all-report' targets, which merge several executable targets coverage data to a single report. Effective on executable targets. +# EXTERNAL - For GCC's lcov, allows the profiling of 'external' files from the processing directory +# COVERAGE_TARGET_NAME - For executables ONLY, changes the outgoing target name so instead of `ccov-${TARGET_NAME}` it becomes `ccov-${COVERAGE_TARGET_NAME}`. +# EXCLUDE - Excludes files of the patterns provided from coverage. Note that GCC/lcov excludes by glob pattern, and clang/LLVM excludes via regex! **These do not copy to the 'all' targets.** +# OBJECTS - For executables ONLY, if the provided targets are shared libraries, adds coverage information to the output +# ARGS - For executables ONLY, appends the given arguments to the associated ccov-* executable call +# ~~~ +function(target_code_coverage TARGET_NAME) + # Argument parsing + set(options AUTO ALL EXTERNAL PUBLIC INTERFACE PLAIN) + set(single_value_keywords COVERAGE_TARGET_NAME) + set(multi_value_keywords EXCLUDE OBJECTS ARGS) + cmake_parse_arguments( + target_code_coverage "${options}" "${single_value_keywords}" + "${multi_value_keywords}" ${ARGN}) + + # Set the visibility of target functions to PUBLIC, INTERFACE or default to + # PRIVATE. + if(target_code_coverage_PUBLIC) + set(TARGET_VISIBILITY PUBLIC) + set(TARGET_LINK_VISIBILITY PUBLIC) + elseif(target_code_coverage_INTERFACE) + set(TARGET_VISIBILITY INTERFACE) + set(TARGET_LINK_VISIBILITY INTERFACE) + elseif(target_code_coverage_PLAIN) + set(TARGET_VISIBILITY PUBLIC) + set(TARGET_LINK_VISIBILITY) + else() + set(TARGET_VISIBILITY PRIVATE) + set(TARGET_LINK_VISIBILITY PRIVATE) + endif() + + if(NOT target_code_coverage_COVERAGE_TARGET_NAME) + # If a specific name was given, use that instead. + set(target_code_coverage_COVERAGE_TARGET_NAME ${TARGET_NAME}) + endif() + + if(CODE_COVERAGE) + + # Add code coverage instrumentation to the target's linker command + if(CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang" + OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?[Cc]lang") + target_compile_options(${TARGET_NAME} ${TARGET_VISIBILITY} + -fprofile-instr-generate -fcoverage-mapping) + target_link_options(${TARGET_NAME} ${TARGET_VISIBILITY} + -fprofile-instr-generate -fcoverage-mapping) + elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES + "GNU") + target_compile_options(${TARGET_NAME} ${TARGET_VISIBILITY} -fprofile-arcs + -ftest-coverage) + target_link_libraries(${TARGET_NAME} ${TARGET_LINK_VISIBILITY} gcov) + endif() + + # Targets + get_target_property(target_type ${TARGET_NAME} TYPE) + + # Add shared library to processing for 'all' targets + if(target_type STREQUAL "SHARED_LIBRARY" AND target_code_coverage_ALL) + if(CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang" + OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?[Cc]lang") + add_custom_target( + ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME} + COMMAND + ${CMAKE_COMMAND} -E echo "-object=$" >> + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list + DEPENDS ccov-preprocessing ${TARGET_NAME}) + + if(NOT TARGET ccov-libs) + message( + FATAL_ERROR + "Calling target_code_coverage with 'ALL' must be after a call to 'add_code_coverage_all_targets'." + ) + endif() + + add_dependencies(ccov-libs + ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME}) + endif() + endif() + + # For executables add targets to run and produce output + if(target_type STREQUAL "EXECUTABLE") + if(CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang" + OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?[Cc]lang") + + # If there are shared objects to also work with, generate the string to + # add them here + foreach(SO_TARGET ${target_code_coverage_OBJECTS}) + # Check to see if the target is a shared object + if(TARGET ${SO_TARGET}) + get_target_property(SO_TARGET_TYPE ${SO_TARGET} TYPE) + if(${SO_TARGET_TYPE} STREQUAL "SHARED_LIBRARY") + set(SO_OBJECTS ${SO_OBJECTS} -object=$) + endif() + endif() + endforeach() + + # Run the executable, generating raw profile data Make the run data + # available for further processing. Separated to allow Windows to run + # this target serially. + add_custom_target( + ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME} + COMMAND + ${CMAKE_COMMAND} -E env + LLVM_PROFILE_FILE=${target_code_coverage_COVERAGE_TARGET_NAME}.profraw + $ ${target_code_coverage_ARGS} + COMMAND + ${CMAKE_COMMAND} -E echo "-object=$" + ${SO_OBJECTS} >> ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list + COMMAND + ${CMAKE_COMMAND} -E echo + "${CMAKE_CURRENT_BINARY_DIR}/${target_code_coverage_COVERAGE_TARGET_NAME}.profraw" + >> ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/profraw.list + JOB_POOL ccov_serial_pool + DEPENDS ccov-preprocessing ccov-libs ${TARGET_NAME}) + + # Merge the generated profile data so llvm-cov can process it + add_custom_target( + ccov-processing-${target_code_coverage_COVERAGE_TARGET_NAME} + COMMAND + ${LLVM_PROFDATA_PATH} merge -sparse + ${target_code_coverage_COVERAGE_TARGET_NAME}.profraw -o + ${target_code_coverage_COVERAGE_TARGET_NAME}.profdata + DEPENDS ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME}) + + # Ignore regex only works on LLVM >= 7 + if(LLVM_COV_VERSION VERSION_GREATER_EQUAL "7.0.0") + foreach(EXCLUDE_ITEM ${target_code_coverage_EXCLUDE}) + set(EXCLUDE_REGEX ${EXCLUDE_REGEX} + -ignore-filename-regex='${EXCLUDE_ITEM}') + endforeach() + endif() + + # Print out details of the coverage information to the command line + add_custom_target( + ccov-show-${target_code_coverage_COVERAGE_TARGET_NAME} + COMMAND + ${LLVM_COV_PATH} show $ ${SO_OBJECTS} + -instr-profile=${target_code_coverage_COVERAGE_TARGET_NAME}.profdata + -show-line-counts-or-regions ${EXCLUDE_REGEX} + DEPENDS ccov-processing-${target_code_coverage_COVERAGE_TARGET_NAME}) + + # Print out a summary of the coverage information to the command line + add_custom_target( + ccov-report-${target_code_coverage_COVERAGE_TARGET_NAME} + COMMAND + ${LLVM_COV_PATH} report $ ${SO_OBJECTS} + -instr-profile=${target_code_coverage_COVERAGE_TARGET_NAME}.profdata + ${EXCLUDE_REGEX} + DEPENDS ccov-processing-${target_code_coverage_COVERAGE_TARGET_NAME}) + + # Export coverage information so continuous integration tools (e.g. + # Jenkins) can consume it + add_custom_target( + ccov-export-${target_code_coverage_COVERAGE_TARGET_NAME} + COMMAND + ${LLVM_COV_PATH} export $ ${SO_OBJECTS} + -instr-profile=${target_code_coverage_COVERAGE_TARGET_NAME}.profdata + -format="text" ${EXCLUDE_REGEX} > + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/${target_code_coverage_COVERAGE_TARGET_NAME}.json + DEPENDS ccov-processing-${target_code_coverage_COVERAGE_TARGET_NAME}) + + # Generates HTML output of the coverage information for perusal + add_custom_target( + ccov-${target_code_coverage_COVERAGE_TARGET_NAME} + COMMAND + ${LLVM_COV_PATH} show $ ${SO_OBJECTS} + -instr-profile=${target_code_coverage_COVERAGE_TARGET_NAME}.profdata + -show-line-counts-or-regions + -output-dir=${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/${target_code_coverage_COVERAGE_TARGET_NAME} + -format="html" ${EXCLUDE_REGEX} + DEPENDS ccov-processing-${target_code_coverage_COVERAGE_TARGET_NAME}) + + elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES + "GNU") + set(COVERAGE_INFO + "${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/${target_code_coverage_COVERAGE_TARGET_NAME}.info" + ) + + # Run the executable, generating coverage information + add_custom_target( + ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME} + COMMAND $ ${target_code_coverage_ARGS} + DEPENDS ccov-preprocessing ${TARGET_NAME}) + + # Generate exclusion string for use + foreach(EXCLUDE_ITEM ${target_code_coverage_EXCLUDE}) + set(EXCLUDE_REGEX ${EXCLUDE_REGEX} --remove ${COVERAGE_INFO} + '${EXCLUDE_ITEM}') + endforeach() + + if(EXCLUDE_REGEX) + set(EXCLUDE_COMMAND ${LCOV_PATH} ${EXCLUDE_REGEX} --output-file + ${COVERAGE_INFO}) + else() + set(EXCLUDE_COMMAND ;) + endif() + + if(NOT ${target_code_coverage_EXTERNAL}) + set(EXTERNAL_OPTION --no-external) + endif() + + # Capture coverage data + if(${CMAKE_VERSION} VERSION_LESS "3.17.0") + add_custom_target( + ccov-capture-${target_code_coverage_COVERAGE_TARGET_NAME} + COMMAND ${CMAKE_COMMAND} -E remove -f ${COVERAGE_INFO} + COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --zerocounters + COMMAND $ ${target_code_coverage_ARGS} + COMMAND + ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --base-directory + ${CMAKE_SOURCE_DIR} --capture ${EXTERNAL_OPTION} --output-file + ${COVERAGE_INFO} + COMMAND ${EXCLUDE_COMMAND} + DEPENDS ccov-preprocessing ${TARGET_NAME}) + else() + add_custom_target( + ccov-capture-${target_code_coverage_COVERAGE_TARGET_NAME} + COMMAND ${CMAKE_COMMAND} -E rm -f ${COVERAGE_INFO} + COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --zerocounters + COMMAND $ ${target_code_coverage_ARGS} + COMMAND + ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --base-directory + ${CMAKE_SOURCE_DIR} --capture ${EXTERNAL_OPTION} --output-file + ${COVERAGE_INFO} + COMMAND ${EXCLUDE_COMMAND} + DEPENDS ccov-preprocessing ${TARGET_NAME}) + endif() + + # Generates HTML output of the coverage information for perusal + add_custom_target( + ccov-${target_code_coverage_COVERAGE_TARGET_NAME} + COMMAND + ${GENHTML_PATH} -o + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/${target_code_coverage_COVERAGE_TARGET_NAME} + ${COVERAGE_INFO} + DEPENDS ccov-capture-${target_code_coverage_COVERAGE_TARGET_NAME}) + endif() + + add_custom_command( + TARGET ccov-${target_code_coverage_COVERAGE_TARGET_NAME} + POST_BUILD + COMMAND ; + COMMENT + "Open ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/${target_code_coverage_COVERAGE_TARGET_NAME}/index.html in your browser to view the coverage report." + ) + + # AUTO + if(target_code_coverage_AUTO) + if(NOT TARGET ccov) + add_custom_target(ccov) + endif() + add_dependencies(ccov ccov-${target_code_coverage_COVERAGE_TARGET_NAME}) + + if(NOT CMAKE_C_COMPILER_ID MATCHES "GNU" AND NOT CMAKE_CXX_COMPILER_ID + MATCHES "GNU") + if(NOT TARGET ccov-report) + add_custom_target(ccov-report) + endif() + add_dependencies( + ccov-report + ccov-report-${target_code_coverage_COVERAGE_TARGET_NAME}) + endif() + endif() + + # ALL + if(target_code_coverage_ALL) + if(NOT TARGET ccov-all-processing) + message( + FATAL_ERROR + "Calling target_code_coverage with 'ALL' must be after a call to 'add_code_coverage_all_targets'." + ) + endif() + + add_dependencies(ccov-all-processing + ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME}) + endif() + endif() + endif() +endfunction() + +# Adds code coverage instrumentation to all targets in the current directory and +# any subdirectories. To add coverage instrumentation to only specific targets, +# use `target_code_coverage`. +function(add_code_coverage) + if(CODE_COVERAGE) + if(CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang" + OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?[Cc]lang") + add_compile_options(-fprofile-instr-generate -fcoverage-mapping) + add_link_options(-fprofile-instr-generate -fcoverage-mapping) + elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES + "GNU") + add_compile_options(-fprofile-arcs -ftest-coverage) + link_libraries(gcov) + endif() + endif() +endfunction() + +# Adds the 'ccov-all' type targets that calls all targets added via +# `target_code_coverage` with the `ALL` parameter, but merges all the coverage +# data from them into a single large report instead of the numerous smaller +# reports. Also adds the ccov-all-capture Generates an all-merged.info file, for +# use with coverage dashboards (e.g. codecov.io, coveralls). +# ~~~ +# Optional: +# EXCLUDE - Excludes files of the patterns provided from coverage. Note that GCC/lcov excludes by glob pattern, and clang/LLVM excludes via regex! +# ~~~ +function(add_code_coverage_all_targets) + # Argument parsing + set(multi_value_keywords EXCLUDE) + cmake_parse_arguments(add_code_coverage_all_targets "" "" + "${multi_value_keywords}" ${ARGN}) + + if(CODE_COVERAGE) + if(CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang" + OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?[Cc]lang") + + # Merge the profile data for all of the run executables + if(WIN32) + add_custom_target( + ccov-all-processing + COMMAND + powershell -Command $$FILELIST = Get-Content + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/profraw.list\; llvm-profdata.exe + merge -o ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged.profdata + -sparse $$FILELIST) + else() + add_custom_target( + ccov-all-processing + COMMAND + ${LLVM_PROFDATA_PATH} merge -o + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged.profdata -sparse `cat + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/profraw.list`) + endif() + + # Regex exclude only available for LLVM >= 7 + if(LLVM_COV_VERSION VERSION_GREATER_EQUAL "7.0.0") + foreach(EXCLUDE_ITEM ${add_code_coverage_all_targets_EXCLUDE}) + set(EXCLUDE_REGEX ${EXCLUDE_REGEX} + -ignore-filename-regex='${EXCLUDE_ITEM}') + endforeach() + endif() + + # Print summary of the code coverage information to the command line + if(WIN32) + add_custom_target( + ccov-all-report + COMMAND + powershell -Command $$FILELIST = Get-Content + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list\; llvm-cov.exe + report $$FILELIST + -instr-profile=${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged.profdata + ${EXCLUDE_REGEX} + DEPENDS ccov-all-processing) + else() + add_custom_target( + ccov-all-report + COMMAND + ${LLVM_COV_PATH} report `cat + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list` + -instr-profile=${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged.profdata + ${EXCLUDE_REGEX} + DEPENDS ccov-all-processing) + endif() + + # Export coverage information so continuous integration tools (e.g. + # Jenkins) can consume it + add_custom_target( + ccov-all-export + COMMAND + ${LLVM_COV_PATH} export `cat + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list` + -instr-profile=${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged.profdata + -format="text" ${EXCLUDE_REGEX} > + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/coverage.json + DEPENDS ccov-all-processing) + + # Generate HTML output of all added targets for perusal + if(WIN32) + add_custom_target( + ccov-all + COMMAND + powershell -Command $$FILELIST = Get-Content + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list\; llvm-cov.exe show + $$FILELIST + -instr-profile=${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged.profdata + -show-line-counts-or-regions + -output-dir=${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged + -format="html" ${EXCLUDE_REGEX} + DEPENDS ccov-all-processing) + else() + add_custom_target( + ccov-all + COMMAND + ${LLVM_COV_PATH} show `cat + ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list` + -instr-profile=${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged.profdata + -show-line-counts-or-regions + -output-dir=${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged + -format="html" ${EXCLUDE_REGEX} + DEPENDS ccov-all-processing) + endif() + + elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES + "GNU") + set(COVERAGE_INFO "${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged.info") + + # Nothing required for gcov + add_custom_target(ccov-all-processing COMMAND ;) + + # Exclusion regex string creation + set(EXCLUDE_REGEX) + foreach(EXCLUDE_ITEM ${add_code_coverage_all_targets_EXCLUDE}) + set(EXCLUDE_REGEX ${EXCLUDE_REGEX} --remove ${COVERAGE_INFO} + '${EXCLUDE_ITEM}') + endforeach() + + if(EXCLUDE_REGEX) + set(EXCLUDE_COMMAND ${LCOV_PATH} ${EXCLUDE_REGEX} --output-file + ${COVERAGE_INFO}) + else() + set(EXCLUDE_COMMAND ;) + endif() + + # Capture coverage data + if(${CMAKE_VERSION} VERSION_LESS "3.17.0") + add_custom_target( + ccov-all-capture + COMMAND ${CMAKE_COMMAND} -E remove -f ${COVERAGE_INFO} + COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --capture + --output-file ${COVERAGE_INFO} + COMMAND ${EXCLUDE_COMMAND} + DEPENDS ccov-preprocessing ccov-all-processing) + else() + add_custom_target( + ccov-all-capture + COMMAND ${CMAKE_COMMAND} -E rm -f ${COVERAGE_INFO} + COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --capture + --output-file ${COVERAGE_INFO} + COMMAND ${EXCLUDE_COMMAND} + DEPENDS ccov-preprocessing ccov-all-processing) + endif() + + # Generates HTML output of all targets for perusal + add_custom_target( + ccov-all + COMMAND ${GENHTML_PATH} -o ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged + ${COVERAGE_INFO} -p ${CMAKE_SOURCE_DIR} + DEPENDS ccov-all-capture) + + endif() + + add_custom_command( + TARGET ccov-all + POST_BUILD + COMMAND ; + COMMENT + "Open ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/all-merged/index.html in your browser to view the coverage report." + ) + endif() +endfunction() diff --git a/xo-indentlog/xo-cmake/cmake/xo_macros/xo-project-macros.cmake b/xo-indentlog/xo-cmake/cmake/xo_macros/xo-project-macros.cmake new file mode 100644 index 00000000..a18c9b8d --- /dev/null +++ b/xo-indentlog/xo-cmake/cmake/xo_macros/xo-project-macros.cmake @@ -0,0 +1,2 @@ +include(xo_macros/xo_cxx) +include(xo_macros/code-coverage) diff --git a/xo-indentlog/xo-cmake/cmake/xo_macros/xo_cxx.cmake b/xo-indentlog/xo-cmake/cmake/xo_macros/xo_cxx.cmake new file mode 100644 index 00000000..a5c0e3c3 --- /dev/null +++ b/xo-indentlog/xo-cmake/cmake/xo_macros/xo_cxx.cmake @@ -0,0 +1,1426 @@ +option(XO_ENABLE_EXAMPLES "enable building example programs" OFF) + +macro(xo_cxx_config_message) + message(STATUS "GUESSED_CMAKE_CMD=cmake -DXO_CMAKE_CONFIG_EXECUTABLE=${XO_CMAKE_CONFIG_EXECUTABLE} -DENABLE_TESTING=${ENABLE_TESTING} -DXO_ENABLE_EXAMPLES=${XO_ENABLE_EXAMPLES} -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH} -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_DOCDIR=${CMAKE_INSTALL_DOCDIR} -B ${CMAKE_BINARY_DIR}") + message(STATUS "XO_CMAKE_CONFIG_EXECUTABLE=${XO_CMAKE_CONFIG_EXECUTABLE}") + message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") +endmacro() + +macro(xo_cxx_bootstrap_message) + if (NOT XO_SUBMODULE_BUILD) + xo_cxx_config_message() + endif() +endmacro() + +# deprecated -- prefer xo_cxx_toplevel_options2() +macro(xo_cxx_toplevel_options) + message(WARNING "deprecated: prefer xo_cxx_toplevel_options2") + + message("xo_cxx_toplevel_options: PROJECT=${PROJECT_NAME}") + + enable_language(CXX) + xo_toplevel_compile_options() + xo_toplevel_testing_options() + + add_custom_target(all_executables_${PROJECT_NAME}) + set_property( + TARGET all_executables_${PROJECT_NAME} + PROPERTY targets "") + + add_custom_target(all_libraries_${PROJECT_NAME}) + set_property( + TARGET all_libraries_${PROJECT_NAME} + PROPERTY targets "") +endmacro() + +# deprecated -- prefer xo_cxx_toplevel_options3() +macro(xo_cxx_toplevel_options2) + if (NOT DEFINED _xo_cxx_toplevel_done) + message("xo_cxx_toplevel_options2: PROJECT=${PROJECT_NAME}") + + enable_language(CXX) + xo_toplevel_compile_options() + enable_testing() + + add_custom_target(all_executables_${PROJECT_NAME}) + set_property( + TARGET all_executables_${PROJECT_NAME} + PROPERTY targets "") + + add_custom_target(all_libraries_${PROJECT_NAME}) + set_property( + TARGET all_libraries_${PROJECT_NAME} + PROPERTY targets "") + + add_custom_target(all_utest_executables_${PROJECT_NAME}) + set_property( + TARGET all_utest_executables_${PROJECT_NAME} + PROPERTY targets "") + endif() +endmacro() + +macro(xo_cxx_toplevel_options3) + xo_cxx_toplevel_options2() + xo_toplevel_config2() +endmacro() + +macro(xo_toplevel_testing_options) + enable_testing() + add_code_coverage() + add_code_coverage_all_targets(EXCLUDE /nix/store* utest/*) + + add_custom_target(all_utest_executables_${PROJECT_NAME}) + set_property( + TARGET all_utest_executables_${PROJECT_NAME} + PROPERTY targets "") +endmacro() + +# default build (cmake -DCMAKE_BUILD_TYPE= path/to/source) +# +macro(xo_toplevel_default_config2) + if ("${CMAKE_BUILD_TYPE}" STREQUAL "") + # clear out hardwired default. + # we want to override project-level defaults, + # but need to prevent interference from hardwired defaults + # (the problem with non-empty hardwired defaults is that we can't tell if they've + # been set on the command line) + # + set(CMAKE_CXX_FLAGS_DEFAULT "") + + # CMAKE_CXX_FLAGS_DEBUG is built-in to cmake and has non-empty default. + # -> we cannot tell whether it was set on the command line + # -> use PROJECT_CXX_FLAGS_DEBUG instead + # + # built-in default value is -g; can hardwire different project policy here + # + if (NOT DEFINED PROJECT_CXX_FLAGS_DEFAULT) + set(PROJECT_CXX_FLAGS_DEFAULT ${PROJECT_CXX_FLAGS} -fno-strict-aliasing -O + CACHE STRING "default c++ compiler flags") + endif() + + message(STATUS "PROJECT_CXX_FLAGS_DEFAULT: default c++ flags are [${PROJECT_CXX_FLAGS_DEFAULT}]") + + # note no $ selector here + add_compile_options("${PROJECT_CXX_FLAGS_DEFAULT}") + endif() +endmacro() + +# release build (cmake -DCMAKE_BUILD_TYPE=release path/to/source) +# +macro(xo_toplevel_release_config2) + if ("${CMAKE_BUILD_TYPE}" STREQUAL "release") + # clear out hardwired default + # we want to override project-level defaults, + # but need to prevent interference from hardwired defaults + # (the problem with non-empty hardwired defaults is that we can't tell if they've + # been set on the command line) + # + set(CMAKE_CXX_FLAGS_RELEASE "") + + # CMAKE_CXX_FLAGS_RELEASE is built-in to cmake and has non-empty default + # -> we cannot tell whether it was set on the command line + # -> use PROJECT_CXX_FLAGS_RELEASE instead + # + # built-in default value is -march=native -O3 -DNDEBUG + # + if (NOT DEFINED PROJECT_CXX_FLAGS_RELEASE) + set(PROJECT_CXX_FLAGS_RELEASE ${PROJECT_CXX_FLAGS} -fno-strict-aliasing -march=native -O3 -DNDEBUG + CACHE STRING "release c++ compiler flags") + endif() + + message(STATUS "PROJECT_CXX_FLAGS_RELEASE: release c++ flags are [${PROJECT_CXX_FLAGS_RELEASE}]") + + add_compile_options("$<$:${PROJECT_CXX_FLAGS_RELEASE}>") + endif() +endmacro() + +# debug build (cmake -DCMAKE_BUILD_TYPE=debug path/to/source) +# +macro(xo_toplevel_debug_config2) + if ("${CMAKE_BUILD_TYPE}" STREQUAL "debug") + # clear out hardwired default. + # we want to override project-level defaults, + # but need to prevent interference from hardwired defaults + # (the problem with non-empty hardwired defaults is that we can't tell if they've + # been set on the command line) + # + set(CMAKE_CXX_FLAGS_DEBUG "") + + # CMAKE_CXX_FLAGS_DEBUG is built-in to cmake and has non-empty default. + # -> we cannot tell whether it was set on the command line + # -> use PROJECT_CXX_FLAGS_DEBUG instead + # + # built-in default value is -g; can hardwire different project policy here + # + if (NOT DEFINED PROJECT_CXX_FLAGS_DEBUG) + set(PROJECT_CXX_FLAGS_DEBUG ${PROJECT_CXX_FLAGS} -fno-strict-aliasing -ggdb -Og + CACHE STRING "debug c++ compiler flags") + endif() + + message(STATUS "PROJECT_CXX_FLAGS_DEBUG: debug c++ flags are [${PROJECT_CXX_FLAGS_DEBUG}]") + + add_compile_options("$<$:${PROJECT_CXX_FLAGS_DEBUG}>") + endif() +endmacro() + + +# asan (address sanitizer) build (cmake -DCMAKE_BUILD_TYPE=asan path/to/source) +# +macro(xo_toplevel_asan_config2) + if ("${CMAKE_BUILD_TYPE}" STREQUAL "asan") + # following the same pattern used for xo_toplevel_debug_config2(), + # although not needed here (if PROJECT_CXX_FLAGS_ASAN has no builtin default value) + + set(CMAKE_CXX_FLAGS_ASAN "") + + if (NOT DEFINED PROJECT_CXX_FLAGS_ASAN) + set(PROJECT_CXX_FLAGS_ASAN ${PROJECT_CXX_FLAGS} -fno-strict-aliasing -Og -fsanitize=address + CACHE STRING "asan c++ compiler flags") + endif() + + message(STATUS "PROJECT_CXX_FLAGS_ASAN: asan c++ flags are [${PROJECT_CXX_FLAGS_ASAN}]") + + add_compile_options("$<$:${PROJECT_CXX_FLAGS_ASAN}>") + + if (NOT DEFINED PROJECT_LINK_FLAGS_ASAN) + set(PROJECT_LINK_FLAGS_ASAN ${PROJECT_LINK_FLAGS} -fsanitize=address + CACHE STRING "asan link flags") + endif() + message(STATUS "PROJECT_LINK_FLAGS_ASAN: asan link flags are [${PROJECT_LINK_FLAGS_ASAN}]") + + add_link_options("$<$:${PROJECT_LINK_FLAGS_ASAN}>") + endif() +endmacro() + +# support for +# cmake -DCMAKE_BUILD_TYPE= +# cmake -DCMAKE_BUILD_TYPE=release +# cmake -DCMAKE_BUILD_TYPE=debug +# cmake -DCMAKE_BUILD_TYPE=asan +# cmake -DCMAKE_BUILD_TYPE=coverage +# +macro(xo_toplevel_config2) + xo_toplevel_default_config2() + xo_toplevel_release_config2() + xo_toplevel_debug_config2() + xo_toplevel_asan_config2() + xo_toplevel_coverage_config2() +endmacro() + +# coverage build: +# 0. +# (cmake -DCMAKE_BUILD_TYPE=coverage path/to/source) +# 1. invoke instrumented executables for which you want coverage: +# (cmake --build path/to/build -- test) +# 2. post-process low-level coverage data +# (path/to/build/gen-ccov) +# 3. point browser to generated html data +# file:///path/to/build/ccov/html/index.html +# +macro(xo_toplevel_coverage_config2) + if ("${CMAKE_BUILD_TYPE}" STREQUAL "coverage") + #find_program(LCOV_EXECUTABLE NAMES lcov) + #find_program(GENHTML_EXECUTABLE NAMES genhtml) + # see bin/xo-cmake-lcov-harness in this repo + execute_process(COMMAND ${XO_CMAKE_CONFIG_EXECUTABLE} --lcov-harness-exe OUTPUT_VARIABLE XO_CMAKE_LCOV_HARNESS_EXECUTABLE) + execute_process(COMMAND ${XO_CMAKE_CONFIG_EXECUTABLE} --gen-ccov-template OUTPUT_VARIABLE XO_CMAKE_GEN_CCOV_TEMPLATE) + + if (NOT DEFINED PROJECT_CXX_FLAGS_COVERAGE) + # note: for clang would use -fprofile-instr-generate -fcoverage-mapping here instead and also at link time + set(PROJECT_CXX_FLAGS_COVERAGE -ggdb -Og -fprofile-arcs -ftest-coverage + CACHE STRING "coverage c++ compiler flags") + endif() + message(STATUS "PROJECT_CXX_FLAGS_COVERAGE: coverage c++ flags are [${PROJECT_CXX_FLAGS_COVERAGE}]") + + add_compile_options("$<$:${PROJECT_CXX_FLAGS_COVERAGE}>") + # when -DCMAKE_BUILD_TYPE=coverage, must also link executables with gcov + link_libraries("$<$:gcov>") + + if("${XO_CMAKE_GEN_CCOV_TEMPLATE}" STREQUAL "") + message(ERROR "xo_toplevel_testing_config2: XO_CMAKE_GEN_CCOV_TEMPLATE not set") + message(ERROR "see xo_toplevel_testing_options2()") + else() + message(DEBUG "XO_CMAKE_GEN_CCOV_TEMPLATE=${XO_CMAKE_GEN_CCOV_TEMPLATE}") + configure_file(${XO_CMAKE_GEN_CCOV_TEMPLATE} ${PROJECT_BINARY_DIR}/gen-ccov @ONLY) + file(CHMOD ${PROJECT_BINARY_DIR}/gen-ccov PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + endif() + endif() +endmacro() + +# target to build+install coverage report. +# +macro(xo_utest_coverage_config2) + if (XO_SUBMODULE_BUILD) + # in submodule build, will generate aggregate coverage report + # for all xo libraries. + else() + set(CCOV_OUTPUT_DIR ${PROJECT_BINARY_DIR}/ccov/html) + set(CCOV_INDEX_FILE ${CCOV_OUTPUT_DIR}/index.html) + # see xo_toplevel_coverage_report() + set(CCOV_REPORT_EXE ${PROJECT_BINARY_DIR}/gen-ccov) + # CMAKE_INSTALL_DOCDIR + # =default=> DATAROOTDIR/doc/PROJECT_NAME + # =default=> CMAKE_INSTALL_PREFIX/share/doc/xo_flatstring + set(CCOV_INSTALL_DOCDIR ${CMAKE_INSTALL_DOCDIR}/ccov) + + # collect utest deps (like xo_doxygen_collect_deps()) + get_target_property(_all_utests all_utest_executables_${PROJECT_NAME} targets) + message(DEBUG "_all_utests=${_all_utests}") + + # 'test' target should always be out-of-date + # + # DEPENDS: reminder - can't put 'test' here, requires 'all' target + # + add_custom_command( + OUTPUT ${CCOV_INDEX_FILE} + DEPENDS ${_all_utests} + COMMAND ${CCOV_REPORT_EXE} + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + COMMENT "Generating coverage report -> [${CCOV_OUTPUT_DIR}]") + + add_custom_target( + ccov + DEPENDS ${CCOV_INDEX_FILE} ${SELF_EXE}) + + # OPTIONAL: quietly skip this step if ccov report not generated + install( + DIRECTORY ${CCOV_OUTPUT_DIR} + FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ + DESTINATION ${CCOV_INSTALL_DOCDIR} + COMPONENT Documentation + OPTIONAL) + endif() +endmacro() + +# caller should set ALL_LIBRARY_TARGETS ALL_UTEST_TARGETS before calling +# xo_doxygen_standard_deps(). +# +# xo_add_headeronly_library4(), xo_add_shared_library4(), xo_pybind11_library() +# all add their target to ALL_LIBRARY_TARGETS. +# +macro(xo_doxygen_collect_deps) + get_target_property(_all_exes all_executables_${PROJECT_NAME} targets) + get_target_property(_all_libs all_libraries_${PROJECT_NAME} targets) + get_target_property(_all_utests all_utest_executables_${PROJECT_NAME} targets) + + message(DEBUG "_all_exes=${_all_exes}") + message(DEBUG "_all_libs=${_all_libs}") + message(DEBUG "_all_utests=${_all_utests}") + + ## .hpp files reachable from xo-flatstring/include + ## + ## REMINDER: for reliability will need to re-run cmake when the set of .hpp files changes + ## + #file(GLOB_RECURSE DOX_HPP_FILES_GLOB ${PROJECT_SOURCE_DIR}/include "*.hpp") + #message(STATUS "DOX_HPP_FILES_GLOB=${DOX_HPP_FILES_GLOB}") + #set(DOX_DEPS ${_all_libs} ${_all_utests} ${DOX_HPP_FILES_GLOB}) + + set(DOX_DEPS ${_all_exes} ${_all_libs} ${_all_utests}) + + message(STATUS "DOX_DEPS=${DOX_DEPS}") +endmacro() + +# caller must set DOX_DEPS before invoking xo_toplevel_doxygen_config() +# +macro(xo_docdir_doxygen_config) + if (XO_SUBMODULE_BUILD) + # in submodule build, rely on toplevel docs/CMakeLists.txt file instead + else() + # look for doxygen executable + find_program(DOXYGEN_EXECUTABLE NAMES doxygen REQUIRED) + message(STATUS "DOXYGEN_EXECUTABLE=${DOXYGEN_EXECUTABLE}") + + execute_process(COMMAND ${XO_CMAKE_CONFIG_EXECUTABLE} --doxygen-template OUTPUT_VARIABLE DOXYGEN_CONFIG_TEMPLATE) + message(STATUS "DOXYGEN_CONFIG_TEMPLATE=${DOXYGEN_CONFIG_TEMPLATE}") + + set(DOX_CONFIG_FILE ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) + + set(DOX_INPUT_DIR ${PROJECT_SOURCE_DIR}) + set(DOX_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/dox) + + set(DOX_INDEX_FILE ${DOX_OUTPUT_DIR}/html/index.html) + + configure_file( + ${DOXYGEN_CONFIG_TEMPLATE} ${DOX_CONFIG_FILE} + FILE_PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + @ONLY) + + file(MAKE_DIRECTORY ${DOX_OUTPUT_DIR}) + add_custom_command( + OUTPUT ${DOX_INDEX_FILE} + DEPENDS ${DOX_DEPS} + COMMAND "${DOXYGEN_EXECUTABLE}" ${DOX_CONFIG_FILE} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + MAIN_DEPENDENCY ${DOX_CONFIG_FILE} + COMMENT "Generating docs (doxygen)") + + # To build this target + # $ cmake --build .build -j -- doxygen + # or + # $ cd .build + # $ make doxygen + # + add_custom_target( + doxygen + DEPENDS ${DOX_INDEX_FILE} ${DOX_DEPS} + ) + + endif() +endmacro() + +macro(xo_docdir_sphinx_config rst_files) + list(APPEND SPHINX_RST_FILES ${rst_files}) + foreach(arg IN ITEMS ${ARGN}) + list(APPEND SPHINX_RST_FILES ${arg}) + endforeach() + + message(STATUS "SPHINX_RST_FILES=${SPHINX_RST_FILES}") + + if (XO_SUBMODULE_BUILD) + # in submodule build, rely on toplevel docs/CMakeLists.txt file instead + else() + # build docs starting from here only in standalone build. + # otherwise use top-level doxygen setup instead. + + #set(ALL_LIBRARY_TARGETS xo_flatstring) # todo: automate this from xo-cmake macros + #set(ALL_UTEST_TARGETS xo_flatstring_ex1 utest.flatstring) # todo: automate this from xo-cmake macros + + # look for sphinx-build executable + find_program(SPHINX_EXECUTABLE NAMES sphinx-build REQUIRED) + message(STATUS "SPHINX_EXECUTABLE=${SPHINX_EXECUTABLE}") + + set(SPHINX_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/sphinx/html) + set(SPHINX_INDEX_FILE ${SPHINX_OUTPUT_DIR}/index.html) + + # root of sphinx doc tree + set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}) + set(SPHINX_DEPS doxygen conf.py ${SPHINX_RST_FILES} ${SPHINX_RST_FILES_GLOB} ${DOX_DEPS}) + + add_custom_command( + OUTPUT ${SPHINX_INDEX_FILE} + DEPENDS ${SPHINX_DEPS} + COMMAND ${SPHINX_EXECUTABLE} + -b html -Dbreathe_projects.xodoxxml=${CMAKE_CURRENT_BINARY_DIR}/dox/xml + ${SPHINX_SOURCE} ${SPHINX_OUTPUT_DIR} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Generating docs (sphinx) -> [${SPHINX_OUTPUT_DIR}]") + + # make sphinx --> generate sphinx documentation + # + add_custom_target( + sphinx + DEPENDS ${SPHINX_INDEX_FILE}) + + # - html docs generated in build/docs/sphinx + # - copy the doc tree to share/doc/xo_unit/html + # + # DESTINATION: CMAKE_INSTALL_DOCDIR + # => DATAROOTDIR/doc/PROJECT_NAME + # => CMAKE_INSTALL_PREFIX/share/doc/xo_flatstring + # OPTIONAL: install directory tree if it exists, + # but don't complain if it's missing + install( + DIRECTORY ${SPHINX_OUTPUT_DIR} + FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ + DESTINATION ${CMAKE_INSTALL_DOCDIR} + COMPONENT Documentation + OPTIONAL) + + # make docs --> generate sphinx documentation + add_custom_target( + docs + DEPENDS sphinx) + endif() + +endmacro() + +macro(xo_toplevel_compile_options) + define_property( + TARGET + PROPERTY xo_deps + BRIEF_DOCS "transitive completion of xo-dependencies for a target. Used with XO_SUBMODULE_BUILD" + ) + define_property( + TARGET + PROPERTY xo_srcdir + BRIEF_DOCS "snapshot of PROJECT_SOURCE_DIR asof when this target introduced" + ) + define_property( + TARGET + PROPERTY xo_bindir + BRIEF_DOCS "snapshot of PROJECT_BINARY_DIR asof when this target introduced" + ) + + if(NOT DEFINED CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 20) + endif() + if(NOT DEFINED CMAKE_CXX_STANDARD_REQUIRED) + set(CMAKE_CXX_STANDARD_REQUIRED True) + endif() + + if(NOT DEFINED PROJECT_INCLUDE_STEM_DIR) + set(PROJECT_INCLUDE_STEM_DIR xo) + endif() + + # ---------------------------------------------------------------- + # variable + # XO_ADDRESS_SANITIZE + # determines whether to enable address sanitizer for the XO project + # (see toplevel CMakeLists.txt) + # ---------------------------------------------------------------- + if(XO_ADDRESS_SANITIZE) + add_compile_options(-fsanitize=address) + add_link_options(-fsanitize=address) + endif() + + set(XO_STANDARD_COMPILE_OPTIONS -Werror -Wall -Wextra) + # XO_ADDRESS_SANITIZE_COMPILE_OPTIONS: use when XO_ADDRESS_SANITIZE=ON + # + # address sanitizer build complains about _FORTIFY_SOURCE redefines + # In file included from :460: + # :1:9: error: '_FORTIFY_SOURCE' macro redefined [-Werror,-Wmacro-redefined] + # #define _FORTIFY_SOURCE 2 + # + set(XO_ADDRESS_SANITIZE_COMPILE_OPTIONS -Werror -Wall -Wextra -Wno-macro-redefined) + + if(XO_ADDRESS_SANITIZE) + set(XO_COMPILE_OPTIONS ${XO_ADDRESS_SANITIZE_COMPILE_OPTIONS}) + else() + set(XO_COMPILE_OPTIONS ${XO_STANDARD_COMPILE_OPTIONS}) + endif() + + # writes ${PROJECT_BINARY_DIR}/compile_commands.json; + # (symlink from toplevel git dir to tell LSP how to build) + # + # note: trying to protect this with if(NOT DEFINED ..) is /not/ effective + # + set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "") + + if(NOT CMAKE_INSTALL_RPATH) + set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib CACHE STRING + "runpath in installed libraries/executables") + endif() +endmacro() + +# xo_strip_xo_prefix(xo_foo tmp) --> tmp=foo +# xo_strip_xo_prefix(xo-foo tmp) --> tmp=foo +# xo_strip_xo_prefix(foo tmp) --> tmp=foo +# +macro(xo_strip_xo_prefix str outputvar) + string(REGEX REPLACE "^${PROJECT_INCLUDE_STEM_DIR}_" "" _tmp ${str}) + string(REGEX REPLACE "^${PROJECT_INCLUDE_STEM_DIR}-" "" ${outputvar} ${_tmp}) +endmacro() + +# e.g. +# - xo_target = xo_pyutil +# +macro(xo_include_headeronly_options target) + xo_strip_xo_prefix(${target} _nxo_target) + + # ---------------------------------------------------------------- + # PROJECT_SOURCE_DIR: + # so we can for example write + # #include "ordinaltree/foo.hpp" + # from anywhere in the project + # PROJECT_BINARY_DIR: + # since generated version file will be in build directory, + # need that build directory to also appear in + # compiler's include path + # + # NOTE: using INTERFACE here is mandatory. Otherwise get error: + # target_include_directories may only set INTERFACE properties on INTERFACE targets + # + target_include_directories( + ${target} INTERFACE + $ + $ + $ # e.g. for #include "indentlog/scope.hpp" + $ # e.g. for #include "TypeDescr.hpp" in reflect/src when ${target}=reflect + $ # e.g. for generated .hpp files + ) + + # ---------------------------------------------------------------- + # make standard directories for std:: includes explicit + # so that + # (1) they appear in compile_commands.json. + # (2) clangd (run from emacs lsp-mode) can find them + # + if(CMAKE_EXPORT_COMPILE_COMMANDS) + set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}) + endif() +endmacro() + +macro(xo_include_headeronly_options2 target) + xo_include_headeronly_options(${target}) +endmacro() + +# ---------------------------------------------------------------- +# use this to introduce a shared library. +# - has symlink-enabled .hpp install +# +macro(xo_add_shared_library4 target projectTargets targetversion soversion sources) + add_library(${target} SHARED ${sources}) + + set_property( + TARGET ${target} + PROPERTY xo_deps "${target}") + set_property( + TARGET ${target} + PROPERTY xo_srcdir ${PROJECT_SOURCE_DIR}) + set_property( + TARGET ${target} + PROPERTY xo_bindir ${PROJECT_BINARY_DIR}) + + foreach(arg IN ITEMS ${ARGN}) + #message("target=${target}; arg=${arg}") + + # to use PUBLIC here would need to split: + # $ + # $ + # but shouldn't need that, since we arrange to install includes via + # xo_include_options2() below + # + target_sources(${target} PRIVATE ${arg}) + endforeach() + + set_property( + TARGET all_libraries_${PROJECT_NAME} + APPEND + PROPERTY targets ${target}) + + set_target_properties( + ${target} + PROPERTIES + VERSION ${targetversion} + SOVERSION ${soversion}) + + xo_compile_options(${target}) + xo_include_options2(${target}) + xo_install_library4(${target} ${projectTargets}) +endmacro() + +# ---------------------------------------------------------------- +# OBSOLETE. prefer xo_add_shared_library4() +# +macro(xo_add_shared_library3 target projectTargets targetversion soversion sources) + message(WARNING "${target}: obsolete call to xo_add_shared_library3(); prefer xo_add_shared_library4()") + + add_library(${target} SHARED ${sources}) + + foreach(arg IN ITEMS ${ARGN}) + #message("target=${target}; arg=${arg}") + + # to use PUBLIC here would need to split: + # $ + # $ + # but shouldn't need that, since we arrange to install includes via + # xo_include_options2() below + # + target_sources(${target} PRIVATE ${arg}) + endforeach() + + set_property( + TARGET all_libraries_${PROJECT_NAME} + APPEND + PROPERTY targets ${target}) + + set_target_properties( + ${target} + PROPERTIES + VERSION ${targetversion} + SOVERSION ${soversion}) + xo_compile_options(${target}) + xo_include_options2(${target}) + xo_install_library3(${target} ${projectTargets}) +endmacro() + +# ---------------------------------------------------------------- +# OBSOLETE. prefer xo_add_shared_library3() +# +macro(xo_add_shared_library target targetversion soversion sources) + message(WARNING "${target}: obsolete call to xo_add_shared_library(); prefer xo_add_shared_library4()") + + add_library(${target} SHARED ${sources}) + + foreach(arg IN ITEMS ${ARGN}) + #message("target=${target}; arg=${arg}") + + # to use PUBLIC here would need to split: + # $ + # $ + # but shouldn't need that, since we arrange to install includes via + # xo_include_options2() below + # + target_sources(${target} PRIVATE ${arg}) + endforeach() + + set_property( + TARGET all_libraries_${PROJECT_NAME} + APPEND + PROPERTY targets ${target}) + + set_target_properties( + ${target} + PROPERTIES + VERSION ${targetversion} + SOVERSION ${soversion}) + xo_compile_options(${target}) + xo_include_options2(${target}) + xo_install_library2(${target}) +endmacro() + +# ---------------------------------------------------------------- +# use this for a header-only library +# +# e.g. +# - target=xo_pyutil cmake target name for this library +# +macro(xo_add_headeronly_library4 target projectTargets) + add_library(${target} INTERFACE) + + set_property( + TARGET all_libraries_${PROJECT_NAME} + APPEND + PROPERTY targets ${target}) + + set_property( + TARGET ${target} + PROPERTY xo_deps "${target}") + set_property( + TARGET ${target} + PROPERTY xo_srcdir ${PROJECT_SOURCE_DIR}) + set_property( + TARGET ${target} + PROPERTY xo_bindir ${PROJECT_BINARY_DIR}) + + xo_include_headeronly_options(${target}) + + xo_install_library4(${target} ${projectTargets}) +endmacro() + +macro(xo_add_headeronly_library target) + add_library(${target} INTERFACE) + + set_property( + TARGET all_libraries_${PROJECT_NAME} + APPEND + PROPERTY targets ${target}) + + set_property( + TARGET ${target} + PROPERTY xo_deps "${target}") + set_property( + TARGET ${target} + PROPERTY xo_srcdir ${PROJECT_SOURCE_DIR}) + set_property( + TARGET ${target} + PROPERTY xo_bindir ${PROJECT_BINARY_DIR}) + + xo_include_headeronly_options(${target}) +endmacro() + +# ---------------------------------------------------------------- +# use this for an executable +# +macro(xo_add_executable target sources) + # this only adds the first argument.. + add_executable(${target} ${sources}) + xo_include_options2(${target}) + + # this adds all the remaining arguments + foreach(arg IN ITEMS ${ARGN}) + target_sources(${target} PRIVATE ${arg}) + endforeach() + + # remember executable for certain downstream targets, + # such as xo_doxygen_collect_deps() + # + set_property( + TARGET all_executables_${PROJECT_NAME} + APPEND + PROPERTY targets ${target}) +endmacro() + +# ---------------------------------------------------------------- +# use this for a unit test executable +# +macro(xo_add_utest_executable target sources) + # this only adds the first argument.. + add_executable(${target} ${sources}) + xo_include_options2(${target}) + + add_test(NAME ${target} COMMAND ${target}) + + # this adds all the remaining arguments + foreach(arg IN ITEMS ${ARGN}) + target_sources(${target} PRIVATE ${arg}) + endforeach() + + set_property( + TARGET all_utest_executables_${PROJECT_NAME} + APPEND + PROPERTY targets ${target}) + +endmacro() + +# ---------------------------------------------------------------- +# +# in submodule build each xo codebases cmake files are incorporated +# directly (via add_subdirectory()) into a single umbrella build. +# +# In such case we don't use find_package for xo dependencies +# +macro(xo_establish_submodule_build) + if(NOT DEFINED XO_SUBMODULE_BUILD) + set(XO_SUBMODULE_BUILD False) + endif() +endmacro() + +# ---------------------------------------------------------------- +# use this in subdirs that compile c++ code. +# do not use for header-only subsystems; see xo_include_headeronly_options2() +# +macro(xo_include_options2 target) + xo_establish_submodule_build() + + xo_strip_xo_prefix(${target} _nxo_target) + + #message("xo_include_options2: XO_SUBMODULE_BUILD=${XO_SUBMODULE_BUILD}") + + # ---------------------------------------------------------------- + # PROJECT_SOURCE_DIR: + # so we can for example write + # #include "ordinaltree/foo.hpp" + # from anywhere in the project + # PROJECT_BINARY_DIR: + # since generated version file will be in build directory, + # need that build directory to also appear in + # compiler's include path + # + target_include_directories( + ${target} PUBLIC + $ + $ + $ # e.g. for #include "indentlog/scope.hpp" + #$ # e.g. for #include "Refcounted.hpp" in refcnt/src [DEPRECATED] + $ # e.g. for #include "TypeDescr.hpp" in reflect/src when ${target}=reflect + #$ # e.g. for generated .hpp files + $ # e.g. for generated .hpp files + ) + + # ---------------------------------------------------------------- + # make standard directories for std:: includes explicit + # so that + # (1) they appear in compile_commands.json. + # (2) clangd (run from emacs lsp-mode) can find them + # + if(CMAKE_EXPORT_COMPILE_COMMANDS) + set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}) + endif() +endmacro() + +# ---------------------------------------------------------------- +# +# Require: +# needs to be preceded by call to xo_toplevel_compile_options() +# +macro(xo_compile_options target) + target_compile_options(${target} PRIVATE ${XO_COMPILE_OPTIONS}) +endmacro() + +# ---------------------------------------------------------------- +# +# establish default value for XO_SYMLINK_INSTALL. +# +# may want to use this for a nested build, +# where we want to run cmake for nested codebase using externalproject_add(). +# +# in this case: +# 1. will need to build+install nested project foo to temporary location in build tree, +# so that build artifacts (such as fooConfig.cmake) are available to depending +# projects +# 2. bona fide install with (for example) copied .hpp files interferes with +# cross-codebase development. +# 2a. want changes to original .hpp files to trigger rebuild of depending codebases. +# This won't happen if depending project relies on a copy +# 2b. want IDE that observes compiler commands (i.e. LSP) to visit .hpp files +# in their original codebase, since that's the correct place to make any edits. +# +# see +# - xo_install_include_tree() +# +macro(xo_establish_symlink_install) + if(NOT DEFINED XO_SYMLINK_INSTALL) + set(XO_SYMLINK_INSTALL False) + + #message(XO_SYMLINK_INSTALL=${XO_SYMLINK_INSTALL}) + endif() +endmacro() + +# ---------------------------------------------------------------- +# use this to install typical include file subtree +# +macro(xo_install_include_tree) + message(WARNING "deprecated xo_install_include_tree(); prefer xo_install_include_tree3()") + + xo_establish_symlink_install() + + if(XO_SYMLINK_INSTALL) + message(FATAL_ERROR "symlink install not implemented for ${PROJECT_SOURCE_DIR}/include -- use xo_install_include_tree3()") + else() + install( + DIRECTORY ${PROJECT_SOURCE_DIR}/include/ + FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ + DESTINATION ${CMAKE_INSTALL_PREFIX}/include) + endif() +endmacro() + +# create symlink from ${symlink_path} -> ${dest_path}, +# from +# make install +# +macro(xo_install_make_symlink dest_path symlink_dir symlink_name) + install(CODE "message(\"make_directory: ${symlink_dir}\")") + install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${symlink_dir})") + + install(CODE "message(\"symlink: ${symlink_dir}/${symlink_name} -> ${dest_path}/${symlink_name}\")") + install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${dest_path}/${symlink_name} ${symlink_dir}/${symlink_name})") +endmacro() + +# e.g. path = include/xo/foo to install xo-foo/include/xo/foo +# +macro(xo_install_include_tree3 subdir_path) + xo_establish_symlink_install() + + # ugh. cmake doesn't allow input path argument to cmake_path() + # to be a macro variable. + set(_xo_install_include_tree3_subdir_path ${subdir_path}) + set(_xo_install_include_tree3_dirname "") + set(_xo_install_include_tree3_basename "") + cmake_path(GET _xo_install_include_tree3_subdir_path PARENT_PATH _xo_install_include_tree3_dirname) + cmake_path(GET _xo_install_include_tree3_subdir_path FILENAME _xo_install_include_tree3_basename) + + if(XO_SYMLINK_INSTALL) + + xo_install_make_symlink( + ${PROJECT_SOURCE_DIR}/${_xo_install_include_tree3_dirname} + ${CMAKE_INSTALL_PREFIX}/${_xo_install_include_tree3_dirname} + ${_xo_install_include_tree3_basename}) + else() + install( + DIRECTORY ${PROJECT_SOURCE_DIR}/${subdir_path} + FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ + DESTINATION ${CMAKE_INSTALL_PREFIX}/${_xo_install_include_tree3_dirname}) + endif() +endmacro() + +# ---------------------------------------------------------------- +# use this for a subdir that builds a library +# and supports find_package() +# +# note: used deliberately in xo_pybind11_library() below +# +macro(xo_install_library2 target) + install( + TARGETS ${target} + EXPORT ${target}Targets + LIBRARY DESTINATION lib COMPONENT Runtime + ARCHIVE DESTINATION lib COMPONENT Development + RUNTIME DESTINATION bin COMPONENT Runtime + PUBLIC_HEADER DESTINATION include COMPONENT Development + BUNDLE DESTINATION bin COMPONENT Runtime + ) +endmacro() + +macro(xo_install_library3 target projectTargets) + install( + TARGETS ${target} + EXPORT ${projectTargets} + LIBRARY DESTINATION lib COMPONENT Runtime + ARCHIVE DESTINATION lib COMPONENT Development + RUNTIME DESTINATION bin COMPONENT Runtime + PUBLIC_HEADER DESTINATION include COMPONENT Development + BUNDLE DESTINATION bin COMPONENT Runtime + ) + + xo_install_include_tree() +endmacro() + +macro(xo_install_library4 target projectTargets) + xo_strip_xo_prefix(${target} _nxo_target) + + install( + TARGETS ${target} + EXPORT ${projectTargets} + LIBRARY DESTINATION lib COMPONENT Runtime + ARCHIVE DESTINATION lib COMPONENT Development + RUNTIME DESTINATION bin COMPONENT Runtime + PUBLIC_HEADER DESTINATION include COMPONENT Development + BUNDLE DESTINATION bin COMPONENT Runtime + ) + + xo_install_include_tree3(include/${PROJECT_INCLUDE_STEM_DIR}/${_nxo_target}) + + #xo_install_include_tree() -- use xo_install_include_tree3() separately +endmacro() + +macro(xo_install_library4_noincludes target projectTargets) + install( + TARGETS ${target} + EXPORT ${projectTargets} + LIBRARY DESTINATION lib COMPONENT Runtime + ARCHIVE DESTINATION lib COMPONENT Development + RUNTIME DESTINATION bin COMPONENT Runtime + PUBLIC_HEADER DESTINATION include COMPONENT Development + BUNDLE DESTINATION bin COMPONENT Runtime + ) +endmacro() + +# ---------------------------------------------------------------- + +# for projectname=foo, require: +# cmake/fooConfig.cmake.in +# +# prepares +# ${PREFIX}/lib/cmake/foo/fooConfig.cmake +# ${PREFIX}/lib/cmake/foo/fooConfigVersion.cmake +# ${PREFIX}/lib/cmake/foo/fooTargets.cmake +# +macro(xo_export_cmake_config projectname projectversion projecttargets) + include(CMakePackageConfigHelpers) + write_basic_package_version_file( + "${PROJECT_BINARY_DIR}/${projectname}ConfigVersion.cmake" + VERSION ${projectversion} + COMPATIBILITY AnyNewerVersion + ) + configure_package_config_file( + "${PROJECT_SOURCE_DIR}/cmake/${projectname}Config.cmake.in" + "${PROJECT_BINARY_DIR}/${projectname}Config.cmake" + INSTALL_DESTINATION lib/cmake/${projectname} + ) + install( + EXPORT ${projecttargets} + PERMISSIONS OWNER_READ GROUP_READ WORLD_READ + DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/${projectname}) + install( + FILES + "${PROJECT_BINARY_DIR}/${projectname}ConfigVersion.cmake" + "${PROJECT_BINARY_DIR}/${projectname}Config.cmake" + PERMISSIONS OWNER_READ GROUP_READ WORLD_READ + DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/${projectname} + ) +endmacro() + +# ---------------------------------------------------------------- +# helper macro for xo_dependency_helper() see below +# +macro(xo_dependency_helper1 target visibility dep_include_subdir) + target_include_directories(${target} ${visibility} + $) + target_include_directories(${target} ${visibility} + $) + + # note: header directories owned by dep get added to target. + # however, header directories _used_ by dep don't get automatically added to target, + # (for example if referred to from a dep-owned .hpp file) + # +endmacro() + +# ---------------------------------------------------------------- +# dependency helper when depending on an xo codebase +# +# Two flavors: +# - depended-on codebase separately built+installed. +# In this case behaves like any other best-practice cmake dep: +# use find_package() to rely on install .cmake config files +# in PREFIX/lib/cmake +# - depended-on codebase in same umbrella source tree as codebase +# invoking this helper. +# 1. XO_UMBRELLA_SOURCE_DIR gives top of umbrella source tree +# 2. depended-on codebase foo in one of +# XO_UMBRELLA_SOURCE_DIR/repo/{foo, xo-foo} +# +# target: cmake target for which to supply a dependency +# visibility: INTERFACE|PUBLIC +# - INTERFACE must be used when supplying a dependency to a header-only target +# dep: cmake target on which to depend (e.g. xo_pyutil) +# nxo_dep: cmake target without any xo_ prefix. (e.g. pyutil) +# +macro(xo_dependency_helper target visibility dep) + xo_strip_xo_prefix(${dep} _nxo_dep) + + xo_establish_submodule_build() + + if(XO_SUBMODULE_BUILD) + if(EXISTS ${XO_UMBRELLA_SOURCE_DIR}/${XO_UMBRELLA_REPO_SUBDIR}/xo-${_nxo_dep}) + xo_dependency_helper1(${target} ${visibility} ${XO_UMBRELLA_REPO_SUBDIR}/xo-${_nxo_dep}/include) + endif() + + if(EXISTS ${XO_UMBRELLA_SOURCE_DIR}/${XO_UMBRELLA_REPO_SUBDIR}/${_nxo_dep}) + xo_dependency_helper1(${target} ${visibility} ${XO_UMBRELLA_REPO_SUBDIR}/${_nxo_dep}/include) + endif() + + else() + message(STATUS "[${target}] find_package(${dep}) (xo_dependency_helper)") + find_package(${dep} CONFIG REQUIRED) + endif() + + if (XO_SUBMODULE_BUILD) + #get_target_property(_tmp ${target} LINK_LIBRARIES) + #message("xo_dependency_helper: ${target} -> ${dep}: ${target}.LINK_LIBRARIES=${_tmp}") + #get_target_property(_tmp ${dep} LINK_LIBRARIES) + #message("xo_dependency_helper: ${target} -> ${dep}: ${dep}.LINK_LIBRARIES=${_tmp}") + + #get_target_property(_tmp ${target} INTERFACE_LINK_LIBRARIES) + #message("xo_dependency_helper: ${target} -> ${dep}: ${target}.INTERFACE_LINK_LIBRARIES=${_tmp}") + #get_target_property(_tmp ${dep} INTERFACE_LINK_LIBRARIES) + #message("xo_dependency_helper: ${target} -> ${dep}: ${dep}.INTERFACE_LINK_LIBRARIES=${_tmp}") + + # add INCLUDE_DIRECTORIES from ${dep} to ${target}. + # + # 1. we only need this for a submodule build + # 1a. cmake automatically adds ${dep}'s directly-set include directories + # (i.e. attached via target_include_directories(${dep} ..) etc. + # 1b. furthermore, cmake adds transitive deps when we use generated + # cmake support + # 1c. cmake doesn't seem automatically to arrange transitive include directories + # when we have a chain of target_link_libraries() calls. + # (NOTE: it does incorporate include paths from direct dependencies) + # 2. because of 1a, need to exclude ${dep}'s own dirs here (to avoid too-long include path) + # + get_target_property(_depsrcdir ${dep} xo_srcdir) + get_target_property(_depbindir ${dep} xo_bindir) + get_target_property(_tmp ${dep} INTERFACE_INCLUDE_DIRECTORIES) + if(_tmp) + #message("xo_dependency_helper: ${target}: + ${dep}.INCLUDE_DIRECTORIES: ${_tmp}") + foreach(dir ${_tmp}) + # want to add these to compile line for $target}. + # this will happen automatically for ${dep}'s own directories; + # those will have been added by + # xo_include_options2() / xo_include_headeronly_options2() + # however we also need directories for ${dep}'s transitive dependencies + # + if(${dir} MATCHES "BUILD_INTERFACE") + #message("xo_dependency_helper: ${target} -> ${dep}: consider dir=${dir}") + if(${dir} MATCHES ${_depsrcdir}) + #message(" skip ${dir}") + elseif(${dir} MATCHES ${_depbindir}) + #message(" skip ${dir}") + else() + #message(" KEEP ${dir}") + target_include_directories(${target} ${visibility} ${dir}) + endif() + endif() + endforeach() + get_target_property(_tmp ${target} INTERFACE_INCLUDE_DIRECTORIES) + list(REMOVE_DUPLICATES _tmp) + set_property( + TARGET ${target} + PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${_tmp}) + #message("xo_dependency_helper: ${target}.INCLUDE_DIRECTORIES: ${_tmp}") + endif() + endif() + + # want ${target}.xo_deps to contain union of previous value, and ${dep}.xo_deps + set_property( + TARGET ${target} + APPEND + PROPERTY xo_deps ${dep}) + get_target_property(_tmp ${target} xo_deps) + list(REMOVE_DUPLICATES _tmp) + set_property( + TARGET ${target} + PROPERTY xo_deps ${_tmp}) + + #list(REMOVE_DUPLICATES _xo_dependency_tmp1) +endmacro() + +# ---------------------------------------------------------------- +# +# dependency on an xo library (including header-only libraries) +# e.g. indentlog +# +# An xo package foo works with cmake +# find_package(foo) +# by providing plugin .cmake files in +# ${PREFIX}/lib/cmake/foo/fooConfig.cmake +# ${PREFIX}/lib/cmake/foo/fooConfigVersion.cmake +# ${PREFIX}/lib/cmake/foo/fooTargets.cmake +# +# dep: name of required dependency, e.g. indentlog +# +macro(xo_dependency target dep) + xo_establish_submodule_build() + + #message("xo_dependency: XO_SUBMODULE_BUILD=${XO_SUBMODULE_BUILD}") + #message("xo_dependency: XO_UMBRELLA_SOURCE_DIR=${XO_UMBRELLA_SOURCE_DIR}") + #message("xo_dependency: PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}") + + xo_dependency_helper(${target} PUBLIC ${dep}) + + #message("----------------------------------------------------------------") + ##message("xo_dependency: ${target}.xo_deps.pre=${_xo_dependency_tmp0}") + ##message("xo_dependency: ${dep}.xo_deps=${_xo_dependency_tmp2}") + #get_target_property(_tmp ${target} xo_deps) + #message("xo_dependency: ${target}.xo_deps=${_tmp}") + ##get_target_property(_tmp ${target} INCLUDE_DIRECTORIES) + ##message("xo_dependency: ${target}.INCLUDE_DIRECTORIES=${_tmp} before target_link_libraries with ${dep}") + + target_link_libraries(${target} PUBLIC ${dep}) + #target_link_libraries(${target} ${dep}) + + #get_target_property(_tmp ${target} INCLUDE_DIRECTORIES) + #message("xo_dependency: ${target}.INCLUDE_DIRECTORIES=${_tmp} after target_link_libraries with ${dep}") + #get_target_property(_tmp ${dep} INCLUDE_DIRECTORIES) + #message("xo_dependency: ${dep}.INCLUDE_DIRECTORIES=${_tmp}") + #get_target_property(_tmp ${dep} INTERFACE_INCLUDE_DIRECTORIES) + #message("xo_dependency: ${dep}.INTERFACE_INCLUDE_DIRECTORIES=${_tmp}") + #message("----------------------------------------------------------------") +endmacro() + +# dependency of a header-only library on another header-only library +# +macro(xo_headeronly_dependency target dep) + xo_establish_submodule_build() + + xo_dependency_helper(${target} INTERFACE ${dep}) + + # Conflict here between PUBLIC and INTERFACE + # + # PUBLIC ensures that include directories required by ${dep} will also be included in compilation of ${target}; + # i.e. will appear in property ${target}.INCLUDE_DIRECTORIES + # + # INTERFACE mandatory when depending on a header-only library (created with add_library(foo INTERFACE)). + # otherwise get error: + # INTERFACE library can only be used with the INTERFACE keyword of + # target_link_libraries + # Unfortunately target_link_libraries() does not copy dependent's INTERFACE_INCLUDE_DIRECTORIES property + # (at least asof cmake 3.25.3). Dependent's INCLUDE_DIRECTORIES property will be empty, since it's header-only. + # + # Workaround by copying property explicity, which we do below + # + target_link_libraries(${target} INTERFACE ${dep}) + + # get_target_property(xo_dependency_headeronly__tmp ${dep} INTERFACE_INCLUDE_DIRECTORIES) + # set_property( + # TARGET ${target} + # APPEND PROPERTY INCLUDE_DIRECTORIES ${xo_dependency_headeronly__tmp}) +endmacro() + +# dependency on external (non-xo) namespaced target +# e.g. +# add_library(foo ..) or add_executable(foo ...) +# then +# xo_external_namespaced_dependency(foo Catch2 Catch2::Catch2) +# equivalent to +# find_package(Catch2 CONFIG REQUIRED) +# target_link_libraries(foo PUBLIC Catch2::Catch2) +# +macro(xo_external_target_dependency target pkg pkgtarget) + message("-- [${target}] find_package(${pkg}) (xo_external_target_dependency)") + find_package(${pkg} CONFIG REQUIRED) + target_link_libraries(${target} PUBLIC ${pkgtarget}) + #target_link_libraries(${target} ${pkgtarget}) +endmacro() + +# dependency on external (non-xo) target +# +macro(xo_external_dependency target pkg) + xo_external_target_dependency(${target} ${pkg} ${target}) +endmacro() + +# dependency on target provided from this codebase. +# +# 1. don't need find_package() in this case, since details of dep targets +# must be known to cmake for it to build them. +# 2. in any case, can't use find_package() when cmake runs, +# because supporting .cmake files haven't been generated yet +# +macro(xo_self_dependency target dep) + target_link_libraries(${target} PUBLIC ${dep}) +endmacro() + +# dependency on target provided from this codebase. +# +# Similar comments as for xo_self_dependency() +# 1. don't need find_package() in this case, since details of dep targets +# must be known to cmake for it to build them. +# 2. in any case, can't use find_package() when cmake runs, +# because supporting .cmake files haven't been generated yet +# 3. need to use INTERFACE instead of PUBLIC for a header-only dep +# +macro(xo_self_headeronly_dependency target dep) + target_link_libraries(${target} INTERFACE ${dep}) +endmacro() + +# ---------------------------------------------------------------- +# need this when linking pybind11-generated libraries +# +macro(xo_pybind11_link_flags) + # see: + # 1. FAQ Build Issues Q2 + # 2. CMAKE_SHARED_LINKER_FLAGS in src/CMakeLists.txt + # 3. pybind11 cmake support, somewhere like + # [path/to/pybind11-2.9.2/ + # lib/python3.9-pybind11-2.9.2/ + # lib/python3.9/site-packages/ + # pybind11/share/cmake/ + # pybind11/pybind11Common.cmake] + # + set_property( + TARGET pybind11::python_link_helper + APPEND + PROPERTY + INTERFACE_LINK_OPTIONS "$<$:LINKER:-flat_namespace>") + + # looks like pybind11_add_module() tries to link transitive deps + # of libs mentioned in xo_dependency() -- perhaps for link-time optimization? + # + # For example when linking libpyreflect, get link line with -lrefcnt + # (presumably since cmake knows that libreflect.so depends on librefcnt.so); + # this triggers error, since link doesn't know where to find librefcnt.so + # + # To workaround, add ${CMAKE_INSTALL_PREFIX}/lib to the link line. + # + # WARNING: expect this not to work in a hermetic nix build! + # + set_property(TARGET pybind11::python_link_helper + APPEND + PROPERTY + INTERFACE_LINK_OPTIONS "-L${CMAKE_INSTALL_PREFIX}/lib") +endmacro() + +# ---------------------------------------------------------------- +# use this for a subdir that builds a python library using pybind11 +# +# expecting the following +# 1. a directory pyfoo/ -> library pyfoo +# 2. pyfoo/pyfoo.hpp.in -> pyfoo/pyfoo.hpp +# +macro(xo_pybind11_library target projectTargets source_files) + xo_strip_xo_prefix(${target} _nxo_target) + + file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/${PROJECT_INCLUDE_STEM_DIR}/${_nxo_target}) + + configure_file( + ${_nxo_target}.hpp.in + ${PROJECT_BINARY_DIR}/include/${PROJECT_INCLUDE_STEM_DIR}/${_nxo_target}/${_nxo_target}.hpp) + # was ${PROJECT_SOURCE_DIR}/include/xo/${target}/${target}.hpp) + + xo_establish_symlink_install() + + if(XO_SYMLINK_INSTALL) + xo_install_make_symlink( + ${PROJECT_BINARY_DIR}/include/xo + ${CMAKE_INSTALL_PREFIX}/include/xo + ${_nxo_target}) + else() + install( + FILES ${PROJECT_BINARY_DIR}/include/${PROJECT_INCLUDE_STEM_DIR}/${_nxo_target}/${_nxo_target}.hpp + PERMISSIONS OWNER_READ GROUP_READ WORLD_READ + DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_INCLUDE_STEM_DIR}/${_nxo_target}) + endif() + + message(STATUS "[${target}] find_package(Python) (xo_pybind11_library)") + find_package(Python COMPONENTS Interpreter Development REQUIRED) + message(STATUS "[${target}] find_package(pybind11) (xo_pybind11_library)") + find_package(pybind11) + + # this only works if one source file, right? + # + # 6oct2023 + # Having trouble at link time with this. + # Getting broken link for nix, because link line lists short library nicknames + # (e.g. -lfoo) for transitive deps. nix link needs to be given the directory + # in which libfoo.so resides, so we need to ensure full path + # + # - source files: + # -fPIC -fvisibility=hidden -flto -fno-fat-lto-objects + # - library: + # -fPIC -flto + # (transitive closure of library deps for lto?) + # + pybind11_add_module(${target} MODULE ${source_files}) + + set_property( + TARGET all_libraries_${PROJECT_NAME} + APPEND + PROPERTY targets ${target}) + + set_property( + TARGET ${target} + PROPERTY xo_deps "${target}") + set_property( + TARGET ${target} + PROPERTY xo_srcdir ${PROJECT_SOURCE_DIR}) + set_property( + TARGET ${target} + PROPERTY xo_bindir ${PROJECT_BINARY_DIR}) + + xo_pybind11_link_flags() + xo_include_options2(${target}) + # don't want to symlink include tree, because lives in build dir. + # see install for generated .hpp above + xo_install_library4_noincludes(${target} ${projectTargets}) +endmacro() + +# ---------------------------------------------------------------- +# use this for a dependency of a pybind11 library, +# e.g. that was introduced by xo_pybind11_library() +# +# Working around the following problem (cmake 3.25.3, pybind11 2.10.4) +# if: +# 1. we have pybind11 library pyfoo, depending on c++ native library foo. +# 2. foo depends on other libraries foodep1, foodep2; +# assume also that foodep2 is header-only +# +# if we write: +# # CMakeLists.txt +# pybind11_add_module(pyfoo MODULE pyfoo.cpp) +# find_package(foo CONFIG_REQUIRED) +# target_link_libraries(pyfoo PUBLIC foo) +# +# get compile instructions like: +# g++ -o pyfoo.cpython-311-x86_64-linux-gnu.so path/to/pyfoo.cpp.o path/to/libfoo.so.x.y -lfoodep1 -lfoodep2 +# +# 1. This is broken for foodep2, since in this case no libfoodep2.so exists +# 2. Also broken for nix build, because directory containing libfoodep1.so doesn't appear on the compile line. +# (It's likely possible to extract this from the .cmake package in lib/cmake/foo/fooTargets.cmake, +# but I don't know how to do that yet) +# +# workaround here is to suppress these secondary dependencies. +# This assumes: +# 1. secondary dependencies are all in shared libraries (not needed on link line) +# 2. (maybe?) primary dependency libfoo.so is sufficient to satisfy g++ +# -- conceivably true if libfoo.so has RUNPATH etc. +# +macro(xo_pybind11_dependency target dep) + xo_establish_submodule_build() + + xo_dependency_helper(${target} PUBLIC ${dep}) + # clobber secondary dependencies, as discussed above + if(XO_SUBMODULE_BUILD) + # ok to keep dep libraries on link line in submodule build + #message("xo_pybind11_dependency: ${target}: don't clobber ${dep}.INTERFACE_LINK_LIBRARIES") + + # looks like also broken in submodule build? + #message("-- [${target}] remove ${dep}.INTERFACE_LINK_LIBRARIES to avoid problems with transitive deps (xo_pybind11_dependency)") + #set_property(TARGET ${dep} PROPERTY INTERFACE_LINK_LIBRARIES "") + else() + message("-- [${target}] remove ${dep}.INTERFACE_LINK_LIBRARIES to avoid problems with transitive deps (xo_pybind11_dependency)") + set_property(TARGET ${dep} PROPERTY INTERFACE_LINK_LIBRARIES "") + + # also have to clobber libraries for + endif() + # now that secondary deps are gone, attach to target pybind11 library + # skip xo_dependency() here, that would repeat the find_package() expansion + target_link_libraries(${target} PUBLIC ${dep}) +endmacro() + +# use when one xo pybind library imports another. +# for example +# pyprintjson -> pyreflect +# +macro(xo_pybind11_header_dependency target dep) + xo_dependency_helper(${target} PUBLIC ${dep}) +endmacro() diff --git a/xo-indentlog/xo-cmake/etc/xo/subsystem-list b/xo-indentlog/xo-cmake/etc/xo/subsystem-list new file mode 100644 index 00000000..d1dcf6c7 --- /dev/null +++ b/xo-indentlog/xo-cmake/etc/xo/subsystem-list @@ -0,0 +1,38 @@ +xo-cmake +xo-indentlog +xo-refcnt +xo-subsys +xo-randomgen +xo-ordinaltree +xo-pyutil +xo-flatstring +xo-reflectutil +xo-reflect +xo-pyreflect +xo-ratio +xo-unit +xo-pyunit +xo-expression +xo-pyexpression +xo-tokenizer +xo-reader +xo-jit +xo-pyjit +xo-callback +xo-webutil +xo-pywebutil +xo-printjson +xo-pyprintjson +xo-reactor +xo-pyreactor +xo-websock +xo-pywebsock +xo-statistics +xo-distribution +xo-pydistribution +xo-simulator +xo-pysimulator +xo-process +xo-pyprocess +xo-kalmanfilter +xo-pykalmanfilter diff --git a/xo-indentlog/xo-cmake/share/xo-macros/Doxyfile.in b/xo-indentlog/xo-cmake/share/xo-macros/Doxyfile.in new file mode 100644 index 00000000..13dfb0fa --- /dev/null +++ b/xo-indentlog/xo-cmake/share/xo-macros/Doxyfile.in @@ -0,0 +1,2816 @@ +# If filename is Doxyfile.in: +# template (to be expanded by cmake) for real doxyfile +# @SOMEVAR@ expands to value of cmake variable SOMEVAR +# +# expressions to be expanded include: +# @DOX_INPUT_DIR@ +# @DOX_OUTPUT_DIR@ +# +# if filename is Doxyfile: +# expanded template in build directory, to configure doxygen + +# Doxyfile 1.9.7 +# + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). +# +# Note: +# +# Use doxygen to compare the used configuration file with the template +# configuration file: +# doxygen -x [configFile] +# Use doxygen to compare the used configuration file with the template +# configuration file without replacing the environment variables or CMake type +# replacement variables: +# doxygen -x_noenv [configFile] + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = "Cmake Examples" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = @DOX_OUTPUT_DIR@ + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096 +# sub-directories (in 2 levels) under the output directory of each output format +# and will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. Adapt CREATE_SUBDIRS_LEVEL to +# control the number of sub-directories. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# Controls the number of sub-directories that will be created when +# CREATE_SUBDIRS tag is set to YES. Level 0 represents 16 directories, and every +# level increment doubles the number of directories, resulting in 4096 +# directories at level 8 which is the default and also the maximum value. The +# sub-directories are organized in 2 levels, the first level always has a fixed +# number of 16 directories. +# Minimum value: 0, maximum value: 8, default value: 8. +# This tag requires that the tag CREATE_SUBDIRS is set to YES. + +CREATE_SUBDIRS_LEVEL = 8 + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Bulgarian, +# Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, English +# (United States), Esperanto, Farsi (Persian), Finnish, French, German, Greek, +# Hindi, Hungarian, Indonesian, Italian, Japanese, Japanese-en (Japanese with +# English messages), Korean, Korean-en (Korean with English messages), Latvian, +# Lithuanian, Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, +# Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, +# Swedish, Turkish, Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = @DOX_INPUT_DIR@ + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# By default Python docstrings are displayed as preformatted text and doxygen's +# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the +# doxygen's special commands can be used and the contents of the docstring +# documentation blocks is shown as doxygen documentation. +# The default value is: YES. + +PYTHON_DOCSTRING = YES + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:^^" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". Note that you cannot put \n's in the value part of an alias +# to insert newlines (in the resulting output). You can put ^^ in the value part +# of an alias to insert a newline as if a physical newline was in the original +# file. When you need a literal { or } or , in the value part of an alias you +# have to escape them by means of a backslash (\), this can lead to conflicts +# with the commands \{ and \} for these it is advised to use the version @{ and +# @} or use a double escape (\\{ and \\}) + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice, +# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. When specifying no_extension you should add +# * to the FILE_PATTERNS. +# +# Note see also the list of default file extension mappings. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See https://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 5. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 5 + +# The MARKDOWN_ID_STYLE tag can be used to specify the algorithm used to +# generate identifiers for the Markdown headings. Note: Every identifier is +# unique. +# Possible values are: DOXYGEN Use a fixed 'autotoc_md' string followed by a +# sequence number starting at 0. and GITHUB Use the lower case version of title +# with any whitespace replaced by '-' and punctations characters removed.. +# The default value is: DOXYGEN. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +MARKDOWN_ID_STYLE = DOXYGEN + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = YES + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +# The NUM_PROC_THREADS specifies the number of threads doxygen is allowed to use +# during processing. When set to 0 doxygen will based this on the number of +# cores available in the system. You can set it explicitly to a value larger +# than 0 to get more control over the balance between CPU load and processing +# speed. At this moment only the input processing can be done using multiple +# threads. Since this is still an experimental feature the default is set to 1, +# which effectively disables parallel processing. Please report any issues you +# encounter. Generating dot graphs in parallel is controlled by the +# DOT_NUM_THREADS setting. +# Minimum value: 0, maximum value: 32, default value: 1. + +NUM_PROC_THREADS = 1 + +# If the TIMESTAMP tag is set different from NO then each generated page will +# contain the date or date and time when the page was generated. Setting this to +# NO can help when comparing the output of multiple runs. +# Possible values are: YES, NO, DATETIME and DATE. +# The default value is: NO. + +TIMESTAMP = NO + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = YES + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = YES + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If this flag is set to YES, the name of an unnamed parameter in a declaration +# will be determined by the corresponding definition. By default unnamed +# parameters remain unnamed in the output. +# The default value is: YES. + +RESOLVE_UNNAMED_PARAMS = YES + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# will also hide undocumented C++ concepts if enabled. This option has no effect +# if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# declarations. If set to NO, these declarations will be included in the +# documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# With the correct setting of option CASE_SENSE_NAMES doxygen will better be +# able to match the capabilities of the underlying filesystem. In case the +# filesystem is case sensitive (i.e. it supports files in the same directory +# whose names only differ in casing), the option must be set to YES to properly +# deal with such files in case they appear in the input. For filesystems that +# are not case sensitive the option should be set to NO to properly deal with +# output files written for symbols that only differ in casing, such as for two +# classes, one named CLASS and the other named Class, and to also support +# references to files without having to specify the exact matching casing. On +# Windows (including Cygwin) and MacOS, users should typically set this option +# to NO, whereas on Linux or other Unix flavors it should typically be set to +# YES. +# Possible values are: SYSTEM, NO and YES. +# The default value is: SYSTEM. + +CASE_SENSE_NAMES = SYSTEM + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class +# will show which file needs to be included to use the class. +# The default value is: YES. + +SHOW_HEADERFILE = YES + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. See also section "Changing the +# layout of pages" for information. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as documenting some parameters in +# a documented function twice, or documenting parameters that don't exist or +# using markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete +# function parameter documentation. If set to NO, doxygen will accept that some +# parameters have no documentation without warning. +# The default value is: YES. + +WARN_IF_INCOMPLETE_DOC = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong parameter +# documentation, but not about the absence of documentation. If EXTRACT_ALL is +# set to YES then this flag will automatically be disabled. See also +# WARN_IF_INCOMPLETE_DOC +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# If WARN_IF_UNDOC_ENUM_VAL option is set to YES, doxygen will warn about +# undocumented enumeration values. If set to NO, doxygen will accept +# undocumented enumeration values. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: NO. + +WARN_IF_UNDOC_ENUM_VAL = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS +# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but +# at the end of the doxygen process doxygen will return with a non-zero status. +# If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS_PRINT then doxygen behaves +# like FAIL_ON_WARNINGS but in case no WARN_LOGFILE is defined doxygen will not +# write the warning messages in between other messages but write them at the end +# of a run, in case a WARN_LOGFILE is defined the warning messages will be +# besides being in the defined file also be shown at the end of a run, unless +# the WARN_LOGFILE is defined as - i.e. standard output (stdout) in that case +# the behavior will remain as with the setting FAIL_ON_WARNINGS. +# Possible values are: NO, YES, FAIL_ON_WARNINGS and FAIL_ON_WARNINGS_PRINT. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# See also: WARN_LINE_FORMAT +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# In the $text part of the WARN_FORMAT command it is possible that a reference +# to a more specific place is given. To make it easier to jump to this place +# (outside of doxygen) the user can define a custom "cut" / "paste" string. +# Example: +# WARN_LINE_FORMAT = "'vi $file +$line'" +# See also: WARN_FORMAT +# The default value is: at line $line of file $file. + +WARN_LINE_FORMAT = "at line $line of file $file" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). In case the file specified cannot be opened for writing the +# warning and error messages are written to standard error. When as file - is +# specified the warning and error messages are written to standard output +# (stdout). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = @DOX_INPUT_DIR@ + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: +# https://www.gnu.org/software/libiconv/) for the list of possible encodings. +# See also: INPUT_FILE_ENCODING +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses The INPUT_FILE_ENCODING tag can be used to specify +# character encoding on a per file pattern basis. Doxygen will compare the file +# name with each pattern and apply the encoding instead of the default +# INPUT_ENCODING) if there is a match. The character encodings are a list of the +# form: pattern=encoding (like *.php=ISO-8859-1). See cfg_input_encoding +# "INPUT_ENCODING" for further information on supported encodings. + +INPUT_FILE_ENCODING = + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# Note the list of default checked file patterns might differ from the list of +# default file extension mappings. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.l, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, +# *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C +# comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, +# *.vhdl, *.ucf, *.qsf and *.ice. + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.idl \ + *.ddl \ + *.odl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.l \ + *.cs \ + *.d \ + *.php \ + *.php4 \ + *.php5 \ + *.phtml \ + *.inc \ + *.m \ + *.markdown \ + *.md \ + *.mm \ + *.dox \ + *.pyw \ + *.f90 \ + *.f95 \ + *.f03 \ + *.f08 \ + *.f18 \ + *.f \ + *.for \ + *.vhd \ + *.vhdl \ + *.ucf \ + *.qsf \ + *.ice + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = */utest/* + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# ANamespace::AClass, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that doxygen will use the data processed and written to standard output +# for further processing, therefore nothing else, like debug statements or used +# commands (so in case of a Windows batch file always use @echo OFF), should be +# written to standard output. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +# The Fortran standard specifies that for fixed formatted Fortran code all +# characters from position 72 are to be considered as comment. A common +# extension is to allow longer lines before the automatic comment starts. The +# setting FORTRAN_COMMENT_AFTER will also make it possible that longer lines can +# be processed before the automatic comment starts. +# Minimum value: 7, maximum value: 10000, default value: 72. + +FORTRAN_COMMENT_AFTER = 72 + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# entity all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see https://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The IGNORE_PREFIX tag can be used to specify a prefix (or a list of prefixes) +# that should be ignored while generating the index headers. The IGNORE_PREFIX +# tag works for classes, function and member names. The entity will be placed in +# the alphabetical list under the first letter of the entity name that remains +# after removing the prefix. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). +# Note: Since the styling of scrollbars can currently not be overruled in +# Webkit/Chromium, the styling will be left out of the default doxygen.css if +# one or more extra stylesheets have been specified. So if scrollbar +# customization is desired it has to be added explicitly. For an example see the +# documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE tag can be used to specify if the generated HTML output +# should be rendered with a dark or light theme. +# Possible values are: LIGHT always generate light mode output, DARK always +# generate dark mode output, AUTO_LIGHT automatically set the mode according to +# the user preference, use light mode if no preference is set (the default), +# AUTO_DARK automatically set the mode according to the user preference, use +# dark mode if no preference is set and TOGGLE allow to user to switch between +# light and dark mode via a button. +# The default value is: AUTO_LIGHT. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE = AUTO_LIGHT + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a color-wheel, see +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use gray-scales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: +# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To +# create a documentation set, doxygen will generate a Makefile in the HTML +# output directory. Running make will produce the docset in that directory and +# running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag determines the URL of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDURL = + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# on Windows. In the beginning of 2021 Microsoft took the original page, with +# a.o. the download links, offline the HTML help workshop was already many years +# in maintenance mode). You can download the HTML help workshop from the web +# archives at Installation executable (see: +# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo +# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe). +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the main .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# The SITEMAP_URL tag is used to specify the full URL of the place where the +# generated documentation will be placed on the server by the user during the +# deployment of the documentation. The generated sitemap is called sitemap.xml +# and placed on the directory specified by HTML_OUTPUT. In case no SITEMAP_URL +# is specified no sitemap is generated. For information about the sitemap +# protocol see https://www.sitemaps.org +# This tag requires that the tag GENERATE_HTML is set to YES. + +SITEMAP_URL = + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location (absolute path +# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to +# run qhelpgenerator on the generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine tune the look of the index (see "Fine-tuning the output"). As an +# example, the default style sheet generated by doxygen has an example that +# shows how to put an image at the root of the tree instead of the PROJECT_NAME. +# Since the tree basically has the same information as the tab index, you could +# consider setting DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = NO + +# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the +# FULL_SIDEBAR option determines if the side bar is limited to only the treeview +# area (value NO) or if it should extend to the full height of the window (value +# YES). Setting this to YES gives a layout similar to +# https://docs.readthedocs.io with more room for contents, but less room for the +# project logo, title, and description. If either GENERATE_TREEVIEW or +# DISABLE_INDEX is set to NO, this option has no effect. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FULL_SIDEBAR = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# If the OBFUSCATE_EMAILS tag is set to YES, doxygen will obfuscate email +# addresses. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +OBFUSCATE_EMAILS = YES + +# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg +# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see +# https://inkscape.org) to generate formulas as SVG images instead of PNGs for +# the HTML output. These images will generally look nicer at scaled resolutions. +# Possible values are: png (the default) and svg (looks nicer but requires the +# pdf2svg or inkscape tool). +# The default value is: png. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FORMULA_FORMAT = png + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. + +FORMULA_MACROFILE = + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# https://www.mathjax.org) which uses client side JavaScript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# With MATHJAX_VERSION it is possible to specify the MathJax version to be used. +# Note that the different versions of MathJax have different requirements with +# regards to the different settings, so it is possible that also other MathJax +# settings have to be changed when switching between the different MathJax +# versions. +# Possible values are: MathJax_2 and MathJax_3. +# The default value is: MathJax_2. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_VERSION = MathJax_2 + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. For more details about the output format see MathJax +# version 2 (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3 +# (see: +# http://docs.mathjax.org/en/latest/web/components/output.html). +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility. This is the name for Mathjax version 2, for MathJax version 3 +# this will be translated into chtml), NativeMML (i.e. MathML. Only supported +# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This +# is the name for Mathjax version 3, for MathJax version 2 this will be +# translated into HTML-CSS) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from https://www.mathjax.org before deployment. The default value is: +# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2 +# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3 +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# for MathJax version 2 (see +# https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions): +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# For example for MathJax version 3 (see +# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html): +# MATHJAX_EXTENSIONS = ams +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /