diff --git a/cmake/modules/DuneMacros.cmake b/cmake/modules/DuneMacros.cmake
index 0b75f16057e2abefdd5d65727cb62d32cd2d1fdd..5b2ff2c47a79de4ecfd422e92f644791c2b0bb8e 100644
--- a/cmake/modules/DuneMacros.cmake
+++ b/cmake/modules/DuneMacros.cmake
@@ -1263,9 +1263,11 @@ macro(add_dune_all_flags targets)
   get_property(incs GLOBAL PROPERTY ALL_PKG_INCS)
   get_property(defs GLOBAL PROPERTY ALL_PKG_DEFS)
   get_property(libs GLOBAL PROPERTY ALL_PKG_LIBS)
+  get_property(opts GLOBAL PROPERTY ALL_PKG_OPTS)
   foreach(target ${targets})
     set_property(TARGET ${target} APPEND PROPERTY INCLUDE_DIRECTORIES ${incs})
     set_property(TARGET ${target} APPEND PROPERTY COMPILE_DEFINITIONS ${defs})
     target_link_libraries(${target} ${DUNE_LIBS} ${libs})
+    target_compile_options(${target} PUBLIC ${opts})
   endforeach()
 endmacro(add_dune_all_flags targets)