From 5ffe118a7bba954ec1c9183c4a31b429d1d16df0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ren=C3=A9=20Milk?= <rene.milk@wwu.de>
Date: Wed, 7 Feb 2018 15:39:30 +0100
Subject: [PATCH] [cmake/py] simplify module libs

---
 python/dune/gdt/CMakeLists.txt | 99 ++++++++++++++++++----------------
 1 file changed, 52 insertions(+), 47 deletions(-)

diff --git a/python/dune/gdt/CMakeLists.txt b/python/dune/gdt/CMakeLists.txt
index 898c831e4..5bcc39089 100644
--- a/python/dune/gdt/CMakeLists.txt
+++ b/python/dune/gdt/CMakeLists.txt
@@ -10,74 +10,79 @@
 #   Tobias Leibner  (2017)
 
 
-set(pybindxi_modules)
-# some top-level modules
-foreach(_target assembler discretefunction projections spaces)
-  dune_pybindxi_add_module(__${_target} EXCLUDE_FROM_ALL ${_target}.bindings.cc)
-  list(APPEND pybindxi_modules __${_target})
-endforeach()
-dune_pybindxi_add_helper_lib(__assembler_helper EXCLUDE_FROM_ALL
+dune_pybindxi_add_module(__discretefunction EXCLUDE_FROM_ALL
+                            discretefunction.bindings.cc)
+
+dune_pybindxi_add_module(__projections EXCLUDE_FROM_ALL
+                            projections.bindings.cc)
+
+dune_pybindxi_add_module(__spaces EXCLUDE_FROM_ALL
+                            spaces.bindings.cc)
+
+dune_pybindxi_add_module(__assembler EXCLUDE_FROM_ALL
+                            assembler.bindings.cc
                             assembler/system.bindings/alu.cc
                             assembler/system.bindings/yasp.cc)
-target_link_libraries(__assembler __assembler_helper)
-dune_pybindxi_add_module(__spaces_block EXCLUDE_FROM_ALL playground/spaces/block.bindings.cc)
-list(APPEND pybindxi_modules __spaces_block)
+
+dune_pybindxi_add_module(__spaces_block EXCLUDE_FROM_ALL
+                            playground/spaces/block.bindings.cc)
+
 # the local operators
 # * diffusive flux estimation
-dune_pybindxi_add_module(__local_diffusive_flux_estimation_operator EXCLUDE_FROM_ALL local/diffusive-flux-estimation-operator.bindings.cc)
-list(APPEND pybindxi_modules __local_diffusive_flux_estimation_operator)
+dune_pybindxi_add_module(__local_diffusive_flux_estimation_operator EXCLUDE_FROM_ALL
+                            local/diffusive-flux-estimation-operator.bindings.cc)
+
 # * elliptic ipdg
-dune_pybindxi_add_module(__local_elliptic_ipdg_operators EXCLUDE_FROM_ALL local/elliptic-ipdg-operators.bindings.cc)
-list(APPEND pybindxi_modules __local_elliptic_ipdg_operators)
+dune_pybindxi_add_module(__local_elliptic_ipdg_operators EXCLUDE_FROM_ALL
+                            local/elliptic-ipdg-operators.bindings.cc)
+
 # the operators
 # * elliptic
-dune_pybindxi_add_helper_lib(__operators_elliptic_helper EXCLUDE_FROM_ALL
+dune_pybindxi_add_module(__operators_elliptic EXCLUDE_FROM_ALL
+                            operators/elliptic.bindings.cc
                             operators/elliptic.bindings/istl.cc)
-dune_pybindxi_add_module(__operators_elliptic EXCLUDE_FROM_ALL operators/elliptic.bindings.cc)
-target_link_libraries(__operators_elliptic __operators_elliptic_helper)
-list(APPEND pybindxi_modules __operators_elliptic)
 # * elliptic-ipdg
-dune_pybindxi_add_helper_lib(__operators_elliptic_ipdg_helper EXCLUDE_FROM_ALL
+dune_pybindxi_add_module(__operators_elliptic_ipdg EXCLUDE_FROM_ALL
+                            operators/elliptic-ipdg.bindings.cc
                             operators/elliptic-ipdg.bindings/alu_istl.cc
                             operators/elliptic-ipdg.bindings/yasp_istl.cc)
-dune_pybindxi_add_module(__operators_elliptic_ipdg EXCLUDE_FROM_ALL operators/elliptic-ipdg.bindings.cc)
-target_link_libraries(__operators_elliptic_ipdg __operators_elliptic_ipdg_helper)
-list(APPEND pybindxi_modules __operators_elliptic_ipdg)
 # * flux reconstruction
-dune_pybindxi_add_module(__operators_fluxreconstruction EXCLUDE_FROM_ALL operators/fluxreconstruction.bindings.cc)
-list(APPEND pybindxi_modules __operators_fluxreconstruction)
+dune_pybindxi_add_module(__operators_fluxreconstruction EXCLUDE_FROM_ALL
+                            operators/fluxreconstruction.bindings.cc)
+
 # * oswald interpolation
-dune_pybindxi_add_module(__operators_oswaldinterpolation EXCLUDE_FROM_ALL operators/oswaldinterpolation.bindings.cc)
-list(APPEND pybindxi_modules __operators_oswaldinterpolation)
+dune_pybindxi_add_module(__operators_oswaldinterpolation EXCLUDE_FROM_ALL
+                            operators/oswaldinterpolation.bindings.cc)
+
 # * L2 operator
-dune_pybindxi_add_module(__operators_l2 EXCLUDE_FROM_ALL operators/l2.bindings.cc)
-list(APPEND pybindxi_modules __operators_l2)
+dune_pybindxi_add_module(__operators_l2 EXCLUDE_FROM_ALL
+                            operators/l2.bindings.cc)
+
 # * weighted L2 operator
-dune_pybindxi_add_module(__operators_weighted_l2 EXCLUDE_FROM_ALL operators/weighted-l2.bindings.cc)
-list(APPEND pybindxi_modules __operators_weighted_l2)
+dune_pybindxi_add_module(__operators_weighted_l2 EXCLUDE_FROM_ALL
+                            operators/weighted-l2.bindings.cc)
+
 # * the operators from ESV2007
-dune_pybindxi_add_module(__operators_ESV2007 EXCLUDE_FROM_ALL playground/operators/ESV2007.bindings.cc)
-list(APPEND pybindxi_modules __operators_ESV2007)
+dune_pybindxi_add_module(__operators_ESV2007 EXCLUDE_FROM_ALL
+                            playground/operators/ESV2007.bindings.cc)
+
 # * the operators from OS2015
-dune_pybindxi_add_module(__operators_OS2015 EXCLUDE_FROM_ALL playground/operators/OS2015.bindings.cc)
-list(APPEND pybindxi_modules __operators_OS2015)
+dune_pybindxi_add_module(__operators_OS2015 EXCLUDE_FROM_ALL
+                            playground/operators/OS2015.bindings.cc)
+
 # the functionals
 # * the operators from RS2017
-dune_pybindxi_add_module(__operators_RS2017 EXCLUDE_FROM_ALL playground/operators/RS2017.bindings.cc)
-list(APPEND pybindxi_modules __operators_RS2017)
-dune_pybindxi_add_helper_lib(__functionals_elliptic_ipdg_helper EXCLUDE_FROM_ALL
+dune_pybindxi_add_module(__operators_RS2017 EXCLUDE_FROM_ALL
+                            playground/operators/RS2017.bindings.cc)
+
+dune_pybindxi_add_module(__functionals_elliptic_ipdg EXCLUDE_FROM_ALL
+                            functionals/elliptic-ipdg.bindings.cc
                             functionals/elliptic-ipdg.bindings/alu_istl.cc
                             functionals/elliptic-ipdg.bindings/yasp_istl.cc)
-dune_pybindxi_add_module(__functionals_elliptic_ipdg EXCLUDE_FROM_ALL functionals/elliptic-ipdg.bindings.cc)
-target_link_libraries(__functionals_elliptic_ipdg __functionals_elliptic_ipdg_helper)
-list(APPEND pybindxi_modules __functionals_elliptic_ipdg)
-dune_pybindxi_add_helper_lib(__functionals_l2_helper EXCLUDE_FROM_ALL
+
+dune_pybindxi_add_module(__functionals_l2 EXCLUDE_FROM_ALL
+                            functionals/l2.bindings.cc
                             functionals/l2.bindings/alu_istl.cc
                             functionals/l2.bindings/yasp_istl.cc)
-dune_pybindxi_add_module(__functionals_l2 EXCLUDE_FROM_ALL functionals/l2.bindings.cc)
-target_link_libraries(__functionals_l2 __functionals_l2_helper)
-list(APPEND pybindxi_modules __functionals_l2)
-foreach(_target ${pybindxi_modules})
-  add_dune_alberta_flags(GRIDDIM 2 ${_target})
-endforeach()
+
 
-- 
GitLab