diff --git a/SConstruct b/SConstruct index 96b09bc1b..2b600eb54 100644 --- a/SConstruct +++ b/SConstruct @@ -313,15 +313,24 @@ def defineBuildTargets(env, artifacts): + srcSubtree(env,'$SRCDIR/common') + srcSubtree(env,'$SRCDIR/lib') ) - objplug = srcSubtree(env,'$SRCDIR/plugin', isShared=True) core = ( env.StaticLibrary('$BINDIR/lumiback.la', objback) + env.StaticLibrary('$BINDIR/lumiproc.la', objproc) + env.StaticLibrary('$BINDIR/lumiera.la', objlib) ) - artifacts['lumiera'] = env.Program('$BINDIR/lumiera', ['$SRCDIR/lumiera/main.cpp']+ core ) - artifacts['plugins'] = env.LoadableModule('$BINDIR/lumiera-plugin', objplug) + + # temporary solution to build the GuiStarterPlugin (TODO: implement plugin building as discussed on November meeting) + envplug = env.Clone() + envplug.Append(CPPPATH='$SRCDIR/plugin', CPPDEFINES='LUMIERA_PLUGIN') + +# objplug = srcSubtree(envplug,'$SRCDIR/plugin', isShared=True) +# guistarterplugin = envplug.LoadableModule('$BINDIR/guistart', objplug, SHLIBPREFIX='') + + objplug = envplug.SharedObject('$SRCDIR/plugin/guistarterplugin.cpp') + guistarterplugin = env.LoadableModule('#$BINDIR/guistart', objplug, SHLIBPREFIX='') + + artifacts['plugins'] = guistarterplugin # the Lumiera GTK GUI envgtk = env.Clone().mergeConf(['gtkmm-2.4','cairomm-1.0','gdl-1.0','librsvg-2.0','xv','xext','sm']) diff --git a/src/lumiera/guifacade.cpp b/src/lumiera/guifacade.cpp index d6a012643..8f06c507a 100644 --- a/src/lumiera/guifacade.cpp +++ b/src/lumiera/guifacade.cpp @@ -44,6 +44,21 @@ namespace gui { using util::dispatchSequenced; + /** path to the dynamic module to load the GUI from + * @todo we need an actual solution. Either find it in the same directory, + * or the lib dir or otherwise retrieve the path from the config system */ + const string LUMIERA_GuiStarterPlugin_path ("liblumiera-plugin.so"); + + inline void + discover_GuiStarterPlugin () + { + LumieraPlugin GuiP = lumiera_plugin_lookup (LUMIERA_GuiStarterPlugin_path.c_str()); + if (!GuiP || lumiera_error_peek()) + throw lumiera::error::Config("unable to load the GUI module from \"" + +LUMIERA_GuiStarterPlugin_path+"\""); + } + + struct GuiRunner @@ -102,6 +117,8 @@ namespace gui { //Lock guard (*this); if (facade) return false; // already started + discover_GuiStarterPlugin(); ////TODO temporary solution + facade.reset ( new GuiRunner ( // trigger loading load the GuiStarterPlugin... dispatchSequenced( closeOnTermination_ // on termination call this->closeGuiModule(*) first diff --git a/tests/SConscript b/tests/SConscript index ef663da0b..38fe59e1f 100644 --- a/tests/SConscript +++ b/tests/SConscript @@ -18,7 +18,7 @@ env.Append(CPPPATH='#/.') # add Rootdir to Includepath, so test/test.h is found def testExecutable(env,tree, exeName=None, obj=None): """ declare all targets needed to create a standalone - Test executalbe of the given Sub-tree. Note that + Test executable of the given Sub-tree. Note that each subdir is built in its own Environment. """ env = env.Clone()