From 556f4491c3ab9020fb114601d1c21bf7c4f05fa8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Steffen=20M=C3=BCthing?= <muething@dune-project.org>
Date: Wed, 14 Feb 2018 18:53:33 +0100
Subject: [PATCH] [cmake] Apply compile options in add_dune_all_flags()

Package registration using dune_register_package_flags() can register compile options that need to
be enabled on a target, but add_dune_all_flags() did not apply them.

This patch fixes that omission.
---
 cmake/modules/DuneMacros.cmake | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cmake/modules/DuneMacros.cmake b/cmake/modules/DuneMacros.cmake
index 0b75f1605..5b2ff2c47 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)
-- 
GitLab