Proposal: Single build directory build
We are still lacking a proper idea how to get rid of the repeated CMake configure runs, which is performed for each module and all its dependencies.
Thus, I want to discuss the idea of a single build directory: the single build directory build.
- A single build directory.
- Within the directory, all core modules are built.
- CMake configure is run for each module, but only once. All CMake variables, targets, Find modules are available for all modules (without re-run or tricky import).
- The dependency resolution is done before the built (make) starts. It would be enough to check the presence of a modules
dune.module
file. - All build artifacts are co-located, e.g.,
lib/
contains libdunecommon, libdunegeometry, libdunegrid and so on. - Quasi-circular dependency like dune-geometry and dune-localfunctions are not a problem, because whatever module is built first knows from the dependency resolution whether the other module is present or not and can conditionally built features and tests.
- As the configuration is done together, we can ensure that all modules have the same flags, the same libraries, the same C++ version and so on.
- It would be possible to have multiple build flavors (different compilers, flags, external dependencies), one per build directory.
- Distribution as RPM or Deb would just include the source code, similar to the tarball. The user have to set up a build directory and build libdunecommon, libdunegeometry and so on.
Edited by Christoph Grüninger