Collects cmake macros to be shared across XO projects (e.g. indentlog, reflect, kalman, ..)
- support for both manyrepo and monorepo projects
- support for generating cmake
xxxConfig.cmake
files, so cmakefind_package()
works reliably - support for header-only libraries
- support for pybind11 libraries
- documentation generation using doxygen + breathe + sphinx
- code coverage using ccov + lcov
$ git clone https://github.com:rconybea/xo-cmake.git
$ cd xo-cmake
$ cmake -DCMAKE_INSTALL_PREFIX=/usr/local -B .build -S . # ..or desired prefix
$ cmake --install .build
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:
- set
XO_CMAKE_CONFIG_EXECUTABLE
(locatexo-cmake-config
) - set
CMAKE_MODULE_PATH
(obtained fromxo-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
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