master repository for XO: cooperating set of C++ libraries for deterministic simulation
  • C++ 87.5%
  • C 6.2%
  • CMake 3.4%
  • Nix 1%
  • Objective-C++ 0.6%
  • Other 1.2%
Find a file
2026-01-11 12:57:24 -05:00
.github/workflows xo-cmake: github: fix xo-cmake-config path 2024-04-25 13:47:47 -04:00
bin cosmetic 2026-01-11 12:32:41 -05:00
cmake/xo_macros xo-cmake: + XO_ENABLE_ASM option to keep assembler output 2026-01-11 12:57:24 -05:00
etc/xo + xo-alloc + xo-object + xo-alloc docs + GC utests 2025-08-03 15:59:38 -05:00
share/xo-macros xo-cmake: doxygen+sphinx working for umbrella2 submodule build 2025-06-22 16:13:37 -05:00
.gitignore xo-cmake: tweaks for toplevel options 2024-05-30 16:34:25 -04:00
CMakeLists.txt xo-cmake: + subsystem-list + xo-build improvements 2025-05-10 12:04:18 -05:00
FAQ xo-cmake: + FAQ 2024-06-26 01:34:24 -04:00
README.md xo-cmake: + xo-build assistant 2024-06-14 15:13:53 -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