Skip to content

Commit 513a9cf

Browse files
committed
Simplified meson build by making dependencies sub projects
1 parent 9efe984 commit 513a9cf

File tree

16 files changed

+35
-1225
lines changed

16 files changed

+35
-1225
lines changed

INSTALL.md

Lines changed: 6 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -20,74 +20,29 @@ libdcmtk-dev libpcre3-dev gcc g++ libsndfile-dev \
2020
libglm-dev
2121
```
2222

23-
## gob2
24-
25-
- Clone is a gtk preprocessor, which was modified for giv and the following version must be used.
26-
- Clone from: https://github.com/dov/gob2/tree/cpp-new
27-
- Check out the `cpp-new` branch.
28-
- Compile as follows:
29-
```
30-
./autogen.sh --prefix=/usr/local
31-
make install
32-
```
33-
34-
## plis
35-
36-
- plis is a string library developed by the author.
37-
- Install as follows:
38-
```
39-
git clone http://github.com/dov/libplis
40-
cd libplis/libplis
41-
scons -u install
42-
```
43-
4423
# Linux
4524

46-
The prefered building system is scons under Linux. automake is currently broken, and I started porting to meson, but I haven't finished it.
25+
The prefered building system is meson under Linux.
4726

4827
## Prerequisites for giv
4928

50-
### libplis
51-
52-
This is a small c++ string library that I have been using for various projects. To install do:
53-
54-
```
55-
git clone http://github.com/dov/libplis
56-
cd libplis
57-
meson setup build && cd build && ninja
58-
sudo ninja install
59-
```
60-
61-
### gob2
62-
63-
This is a small c++ string library that I have been using for various projects. To install do:
64-
65-
```
66-
git clone http://github.com/dov/gob2
67-
cd gob2
68-
git checkout cpp-new
69-
./autogen.sh
70-
make -j 8
71-
make install
72-
```
73-
7429
## Prerequisites for the plugins
7530

7631
- cfitsio-devel
7732
- dcmtk
7833
- libwebp
7934

80-
These are all available by dnf
35+
These are all available by dnf or apt. However, if the dependencies are not found, the plugins are skipped automatically during build.
8136

8237
## Building giv
8338

8439
After all the above plugin have been installed, giv may be built:
8540

86-
To build giv do in the top directory
87-
8841
```
89-
scons -j 8
90-
scons -j 8 install
42+
meson setup build
43+
cd buid
44+
ninja
45+
ninja install
9146
```
9247

9348
# Windows

meson.build

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,28 @@
1-
# Work in progress
21
project('giv', ['c','cpp','vala'],
32
version : '0.9.38',
43
license: 'LGPLv3+')
54

5+
PACKAGE_DOC_DIR = 'doc'
6+
PACKAGE_PLUGIN_DIR = get_option('prefix') + 'lib/giv-1.0/plugins/'
7+
68
add_global_arguments('-DSPDLOG_FMT_EXTERNAL',
79
language : 'cpp')
810

11+
add_global_arguments(['-DPACKAGE_DOC_DIR="'+PACKAGE_DOC_DIR+'" ',
12+
'-DPACKAGE_PLUGIN_DIR="'+PACKAGE_PLUGIN_DIR+'" '],
13+
language : 'cpp')
14+
add_global_arguments(['-DPACKAGE_DOC_DIR="'+PACKAGE_DOC_DIR+'" ',
15+
'-DPACKAGE_PLUGIN_DIR="'+PACKAGE_PLUGIN_DIR+'" '],
16+
language : 'c')
17+
18+
gob2_proj = subproject('gob2')
19+
20+
libsimple_dep = dependency(
21+
'libplis',
22+
fallback : ['libplis', 'libplis_dep'],
23+
default_options: ['default_library=static']
24+
)
25+
926
gnome = import('gnome')
1027
pkgconfig = import('pkgconfig')
1128

src/giv-data.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*/
1010
#include "giv-data.h"
11-
#include "plis/plis.h"
11+
#include "libplis/plis.h"
1212

1313
using namespace plis;
1414

src/giv-parser.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "giv-parser.h"
1010
#include "giv-data.h"
1111
#include "GivStringArray.h"
12-
#include "plis/plis.h"
12+
#include "libplis/plis.h"
1313
#include "WordBoundaries.h"
1414
#include <iostream>
1515
#include <filesystem>

src/giv-win.gob

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ requires 2.0.0
1111
#include <math.h>
1212
#include <gtk/gtk.h>
1313
#include "giv-data.h"
14-
#include "plis/plis.h"
14+
#include "libplis/plis.h"
1515
#include "givimage.h"
1616
#include "glib-jsonrpc/glib-jsonrpc-server.h"
1717
%}

src/giv.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "spdlog/spdlog.h"
1919
#include "spdlog/async_logger.h"
2020
#include <glib/gstdio.h>
21-
#include <plis/plis.h>
21+
#include <libplis/plis.h>
2222

2323

2424
const int GIV_DEFAULT_PORT = 8448;

src/gtkimageviewer/meson.build

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
gob2 = find_program('gob2')
21
patch_src = find_program('patch_src.py')
32

3+
gob2 = gob2_proj.get_variable('gob2_exe')
4+
45
gen_src = custom_target('gen-output',
56
output : ['gtk-image-viewer.h','gtk-image-viewer-private.h','gtk-image-viewer.c'],
67
input : 'gtk-image-viewer.gob',

src/meson.build

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
1-
gob2 = find_program('gob2')
2-
3-
PACKAGE_DOC_DIR = '../doc'
4-
PACKAGE_PLUGIN_DIR = '/usr/local/lib/giv-1.0/plugins/'
5-
6-
add_global_arguments(['-DPACKAGE_DOC_DIR="'+PACKAGE_DOC_DIR+'" ',
7-
'-DPACKAGE_PLUGIN_DIR="'+PACKAGE_PLUGIN_DIR+'" '],
8-
language : 'cpp')
9-
add_global_arguments(['-DPACKAGE_DOC_DIR="'+PACKAGE_DOC_DIR+'" ',
10-
'-DPACKAGE_PLUGIN_DIR="'+PACKAGE_PLUGIN_DIR+'" '],
11-
language : 'c')
1+
gob2 = gob2_proj.get_variable('gob2_exe')
122

133
giv_widget_src = custom_target('gen-output',
144
output : ['giv-widget.h','giv-widget-private.h','giv-widget.cc'],
@@ -29,7 +19,6 @@ giv_widget_sources = [
2919
'giv-data.cc',
3020
'giv-markup.cc',
3121
'giv_agg_arrowhead.cc',
32-
'giv-settings.cc',
3322
'clipper.cpp',
3423
'SutherlandHodgmanPolygonClipping.cc'
3524
]
@@ -46,7 +35,7 @@ gtk_dep = dependency('gtk+-3.0')
4635
fmt_dep = dependency('fmt')
4736
spdlog_dep = dependency('spdlog')
4837
gmodule_dep = dependency('gmodule-2.0')
49-
libplis_dep = dependency('plis')
38+
libplis_dep = dependency('libplis')
5039

5140
libgivwidget = shared_library(
5241
'giv-widget',

src/plis/Makefile.am

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/plis/SConscript

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)