Add include directories to library target
Compare changes
+ 8
− 4
@@ -15,8 +15,10 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules"
@@ -24,8 +26,10 @@ dune_add_library(dunefoamgrid INTERFACE
This properly sets up the dune-foamgrid main target to follow modern CMake practices where the target holds all the information to propagate transitively to other targets. The MR also suppresses the warning that a Dune policy is not set, by setting it to NEW. The consequence is that there is no global include_directories(...)
call in dune_project
anymore and one needs to link all targets that need Dune include directories either to the library target Dune::FoamGrid
(or dunefoamgrid
) or set the include directories manually, e.g., using the utility function dune_default_include_directories(<target> [PUBLIC|PRIVATE|INTERFACE])
. This is especially important for tests. That is why tests should be linked against the library target.