Description
We now provide two ways to resolve dependencies: 1/ having them already installed locally through a package manager or from source and 2/ using mason to download dependencies. Our CMake build system then picks up include paths and library dirs bailing out if dependencies do not match.
The Mason integration is intertwined into out CMake build system mixing those two concepts:
and adding some hundred lines of code to the CMakeLists.
Instead I would love to separate these two aspects:
CMake should not have to worry about dependency management.
It's a build system and not a tool for dependency resolution.
Here's what a solution similar to Python's virtualenv or Nix's nix-shell could look like:
mason-env .mason
. .mason/activate.sh # (prepends env var paths)
mason install libtbb # (or install -r requirements.txt)
mkdir build
cd build
cmake ..
A design like this would allow us to properly split off dependency management from the build system: CMake then finds packages transparently by searching in .mason since we setup env vars appropriately)
I talked to @kkaefer over lunch about this and it sounded like we could pull this off via mason's install / link commands and some glue code as usual.