[Dune] Improve module handling by CMake
Christoph GrĂ¼ninger
foss at grueninger.de
Wed Apr 29 23:47:20 CEST 2020
Hi Oliver,
I don't see an easy way out. But it could be done, even step by step.
This are the steps we should go:
1. Use CMakeCache.txt from dependencies to avoid re-running checks in
later modules. We need to add some extra sorting, as there is not always
a unique ordering. Take dune-common, dune-geometry and dune-istl. When
dune-geometry is run prior to -istl, dune-istl must use -geometry's
cache and not -common's. Dune-grid has to pick up -istl and so on.
Easiest solution would be alphabetical sorting of names to get a unique
ordering.
After this step, dune modules would know the CMake variables in later
modules.
2. Create individual config.h files, for dune-foo this could be
dune-foo-config.h. For every dependency dune-bar dune-foo-config.h would
include dune-bar-config.h. We can stick to config.h, which includes
dune-foo-config.h.
After this step, dune modules know the C preprocessor macros.
3. Improve handling of linking libraries. CMake offers private and
public interface propagation.
After this step, linking and passing additional arguments would be more
CMake-ish.
4. Fix everything that I currently forgot. Get rid of many Dune-ism,
that one wouldn't write today, that I am even not aware of.
If others have different ideas, please share them!
Bye
Christoph
More information about the Dune
mailing list