From b417716a0a6e686d189596ffdaab1e4b8e9679b7 Mon Sep 17 00:00:00 2001
From: Volker Schroer <3470424+dl1ksv@users.noreply.github.com>
Date: Sat, 31 Jul 2021 17:14:12 +0200
Subject: grc cpp generation: Establish the possibility to add find packages

Flowgraphs may use oot modules. When generating cpp code an oot module
may require a package that is not provided by gnuradio.
So I propose to add an additional entry parameters in the cpp template
to provide a list of package names.

Signed-off-by: Volker Schroer <3470424+dl1ksv@users.noreply.github.com>
---
 grc/core/generator/FlowGraphProxy.py | 9 +++++++++
 1 file changed, 9 insertions(+)

(limited to 'grc/core/generator/FlowGraphProxy.py')

diff --git a/grc/core/generator/FlowGraphProxy.py b/grc/core/generator/FlowGraphProxy.py
index f39f25d8fe..38d44e5b13 100644
--- a/grc/core/generator/FlowGraphProxy.py
+++ b/grc/core/generator/FlowGraphProxy.py
@@ -148,6 +148,15 @@ class FlowGraphProxy(object):  # TODO: move this in a refactored Generator
         """
         return [block.cpp_templates.render('link') for block in self.iter_enabled_blocks() if not (block.is_virtual_sink() or block.is_virtual_source())]
 
+    def packages(self):
+        """
+        Get a set of all packages  to find (C++) ( especially for oot modules ) in this flow graph namespace.
+
+        Returns:
+            a list of required packages
+        """
+        return [block.cpp_templates.render('packages') for block in self.iter_enabled_blocks() if not (block.is_virtual_sink() or block.is_virtual_source())]
+
 def get_hier_block_io(flow_graph, direction, domain=None):
     """
     Get a list of io ports for this flow graph.
-- 
cgit v1.2.3