Example of a Conan workspace that collapses several independently versioned packages into a single CMake super-build for development.
The packages live in their own repositories: mathlib, ai, graphics, engine and game.
Requirements: Conan >= 2.31, CMake >= 3.25, git, and a C++ compiler.
$ git clone https://github.com/conan-io/conanci_workspace.git game-dev
$ cd game-dev
# Create the packages in the local Conan cache (plays the role of CI)
$ python bootstrap.py
# Clone the packages to work on, at the exact commit of each package
$ conan workspace add --ref ai/1.0
$ conan workspace add --ref game/1.0
# Add the intermediate packages (engine) that must be rebuilt too
$ conan workspace complete
# Install external dependencies and generate a single toolchain for the super-build
$ conan workspace super-install
$ cmake --preset conan-release # use "conan-default" on Windows
$ cmake --build --preset conan-releaseFiles:
conanws.py: defines the super-buildConanFile(layout, generators, toolchain) and writes the packages build order for CMake.CMakeLists.txt: the super-project, adding each package as a subproject withFetchContentandOVERRIDE_FIND_PACKAGE.conanws.yml: the list of workspace packages, filled byconan workspace add.bootstrap.py: clones the package repositories to a temporary folder and runsconan createin order. Extra arguments are forwarded, e.g.python bootstrap.py -s build_type=Debug.
More information: