[dia: 40/105] #19: Port 'layout' plugin.



commit ae26dae881d2a10050c26b9a09368a1ba4537513
Author: Eduard Nicodei <eddnicodei gmail com>
Date:   Mon Dec 31 19:50:29 2018 +0000

    #19: Port 'layout' plugin.
    
      - Add include directory of app/
      - Build configure file after processing all subdirs.

 app/meson.build             |  2 ++
 meson.build                 |  5 +++--
 plug-ins/layout/meson.build | 29 +++++++++++++++++++++++++----
 plug-ins/meson.build        | 15 ++++++---------
 4 files changed, 36 insertions(+), 15 deletions(-)
---
diff --git a/app/meson.build b/app/meson.build
index 9185a807..1c2db04f 100644
--- a/app/meson.build
+++ b/app/meson.build
@@ -72,6 +72,8 @@ if pkg_config_libdir != ''
     dia_link_args += pkg_config_libdir
 endif
 
+diaapp_inc = include_directories('.')
+
 executable('dia',
     dia_sources + [dia_app_icons_h],
     dependencies : [libgtk_dep, libxml_dep, libm_dep],
diff --git a/meson.build b/meson.build
index 294c6f73..66537d42 100644
--- a/meson.build
+++ b/meson.build
@@ -58,8 +58,6 @@ foreach f : ['select', 'strcspn', 'strdup', 'strtol']
     conf.set10('HAVE_' + f.underscorify().to_upper(), cc.has_function(f))
 endforeach
 
-configure_file(output : 'config.h',
-               configuration : conf)
 configuration_inc = include_directories('.')
 
 # FIXME: I don't think this should be defined.
@@ -76,4 +74,7 @@ subdir('plug-ins')
 subdir('sheets')
 subdir('shapes')
 
+configure_file(output : 'config.h',
+               configuration : conf)
+
 meson.add_install_script('meson-helpers/post-install.py', datadir)
diff --git a/plug-ins/layout/meson.build b/plug-ins/layout/meson.build
index 5fa80724..f065ad71 100644
--- a/plug-ins/layout/meson.build
+++ b/plug-ins/layout/meson.build
@@ -1,7 +1,28 @@
+
 sources = files(
-       'dia-graph.cpp',
-       'layout.cpp',
-    'ogdf-simple.cpp'
+    'dia-graph.cpp',
+    'layout.cpp',
 )
 
-install_plugins_desc += [['layout_filter', sources, []]]
+libogdf_dep = cc.find_library('ogdf', required: false)
+
+deps = [libgtk_dep, libm_dep, libxml_dep]
+
+#TODO: this needs to be tested.
+if libogdf_dep.found() == true
+    conf.set('HAVE_OGDF', 1)
+    deps += [libogdf_dep]
+    sources += ['ogdf-simple.cpp']
+endif
+
+# Need to define it as shared module since it depends
+# on symbols found in the dia *app* (which will be linked at run-time).
+shared_module(
+    'layout_filter',
+    sources,
+    dependencies: deps,
+    include_directories: [libdia_inc, configuration_inc, diaapp_inc],
+    link_with: [libdia],
+    install: true,
+    install_dir: dialibdir
+)
diff --git a/plug-ins/meson.build b/plug-ins/meson.build
index 8c7cf4a3..70d726b4 100644
--- a/plug-ins/meson.build
+++ b/plug-ins/meson.build
@@ -4,21 +4,18 @@
 # Fourth is whether to install or not
 install_plugins_desc = []
 
+# Note that most of these simply append to
+# install_plugins_desc.  Some however have
+# non-standard compilations and therefore are
+# marked as such.
 subdir('cairo')
 subdir('cgm')
-
-# Note that this does not get installed
-subdir('drs')
-
+subdir('drs') # Non-standard: does not get installed.
 subdir('dxf')
 subdir('hpgl')
 subdir('shape')
 subdir('pixbuf')
-
-
-# FIXME: requires OGDF
-#subdir('layout')
-
+subdir('layout')  # Non-standard: shared_module
 subdir('libart')
 subdir('metapost')
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]