xo-umbrella2/xo-cmake
Roland Conybeare 651cc3caf7
Some checks failed
cmake-docker / cmake-build (clang, clang++) (push) Failing after 22m59s
CI / smoke-test (push) Has been cancelled
cmake-docker / cmake-build (gcc, g++) (push) Has been cancelled
xo-cmake: !! subsystem-edges
2026-08-02 21:01:39 -04:00
..
.github/workflows git subrepo clone git@github.com:Rconybea/xo-cmake.git xo-cmake 2026-06-06 21:19:03 -04:00
bin xo-cmake: clang-format: don't touch unch files [UX] 2026-08-02 18:00:49 -04:00
cmake/xo_macros build: generate deps for arenaConfig.cmake automagically [BUILD] 2026-07-31 10:18:08 -04:00
docs/history/2026 git subrepo clone git@github.com:Rconybea/xo-cmake.git xo-cmake 2026-06-06 21:19:03 -04:00
etc/xo xo-cmake: !! subsystem-edges 2026-08-02 21:01:39 -04:00
share/xo-macros git subrepo clone git@github.com:Rconybea/xo-cmake.git xo-cmake 2026-06-06 21:19:03 -04:00
.gitignore git subrepo clone git@github.com:Rconybea/xo-cmake.git xo-cmake 2026-06-06 21:19:03 -04:00
.gitrepo git subrepo push xo-cmake 2026-07-25 13:43:36 -04:00
CMakeLists.txt build xo-cmake: + xo-clang-format-includes script [BUILD] [SDLC] 2026-08-02 13:17:25 -04:00
FAQ git subrepo clone git@github.com:Rconybea/xo-cmake.git xo-cmake 2026-06-06 21:19:03 -04:00
README.md git subrepo clone git@github.com:Rconybea/xo-cmake.git xo-cmake 2026-06-06 21:19:03 -04:00

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