Developing a PoC on an existing code base

Hello there,

tldr: How do I use cmake the right way?

I am developing a proof of concept for an existing code base with a completely foreign build system (SCons). The important bits:

  • We have sources and projects completely separated.
  • Sources are organized into libraries with known inter-dependencies
  • The sources contain unit tests. These unit tests are available for multiple toolchains.
  • There’s an N to M relationship where any project could pull in any library.
  • Many of the projects have multiple target architectures / operating systems
  • There are also package targets that need multiple projects as inputs
  • Some code will be built for one project as a static library and another project as a shared. These can both be pulled into the same package.
  • The code base is buildable under Windows and Linux. Some Windows users will use Visual Studio.

My tentative plan is to:

  1. Start building the libraries with a few toolchains.
  2. Get their unit tests building and executing
  3. Build a project or two

Some requirements of the PoC would be things like:

  1. Users don’t need to touch build scripts to add or remove files to/from libraries
  2. We don’t have an N^2 complexity where every library needs a separate configuration for every toolchain supported

My understanding is that cmake is designed around a single toochain at a time, and that the workaround for this is liberal use ExternalProjects. My assumption is that there are right ways to use cmake, and less desirable ways to use cmake. So my question is if cmake can fit with us, and if so how to find the right course so we have the best representation of what cmake could look like for this PoC?

Thank you!