Move dunecommon target to the root CMakeLists file
Summary
Introduce the dunecommon
library target directly in the root CMakeLists.txt
file.
The pattern I have introduced here is something that I think should be the default:
- Create a module library target in the root
CMakeLists.txt
bydune_add_library(<target> [INTERFACE])
whereINTERFACE
should be used for header-only libraries - If there are sources to compile, add these to the library target in the corresponding
dune/foo/sub/
directories, usingtarget_sources(<target> PRIVATE <sources>...)
- In case you want to set additional flags, or link against additional libraries, either do this in the
CMakeLists.txt
file you had in thelib/
subdirectory, or (better) directly in the rootCMakeLists.txt
file so that all target properties can be found in one spot.
It will be applied step by step also in other modules.