[libdazzle] build: Support installing into private subdir when subproject
- From: Patrick Griffis <pgriffis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdazzle] build: Support installing into private subdir when subproject
- Date: Fri, 9 Jun 2017 22:17:59 +0000 (UTC)
commit 18d2c7ed69c07712650f38f165360ca82e14df92
Author: Patrick Griffis <tingping tingping se>
Date: Fri Jun 9 18:00:45 2017 -0400
build: Support installing into private subdir when subproject
meson.build | 12 +++++++++---
meson_options.txt | 5 ++++-
src/meson.build | 6 ++++--
3 files changed, 17 insertions(+), 6 deletions(-)
---
diff --git a/meson.build b/meson.build
index 4ae1605..6949e4a 100644
--- a/meson.build
+++ b/meson.build
@@ -83,9 +83,15 @@ add_project_arguments(
)
# Setup various paths that subdirectory meson.build files need
-girdir = join_paths(get_option('datadir'), 'gir-1.0')
-typelibdir = join_paths(get_option('libdir'), 'girepository-1.0')
-vapidir = join_paths(get_option('datadir'), 'vala', 'vapi')
+package_subdir = get_option('package_subdir') # When used as subproject
+libdir = join_paths(get_option('libdir'), package_subdir)
+girdir = join_paths(get_option('datadir'), package_subdir, 'gir-1.0')
+typelibdir = join_paths(get_option('libdir'), package_subdir, 'girepository-1.0')
+if package_subdir != ''
+ vapidir = join_paths(get_option('datadir'), package_subdir, 'vapi')
+else
+ vapidir = join_paths(get_option('datadir'), 'vala', 'vapi')
+endif
gnome = import('gnome')
diff --git a/meson_options.txt b/meson_options.txt
index 367bc2f..8bb330a 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -10,4 +10,7 @@ option('enable_rdtscp', type: 'boolean', value: false,
option('with_introspection', type: 'boolean', value: true)
option('with_vapi', type: 'boolean', value: true)
-
+# Subproject
+option('package_subdir', type: 'string',
+ description: 'Subdirectory to append to all installed files, for use as subproject'
+)
diff --git a/src/meson.build b/src/meson.build
index 08198e3..d8948e3 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,5 +1,5 @@
-libdazzle_header_subdir = 'libdazzle-' + apiversion
+libdazzle_header_subdir = join_paths(package_subdir, 'libdazzle-' + apiversion)
libdazzle_header_dir = join_paths(get_option('includedir'), libdazzle_header_subdir)
libdazzle_resources = gnome.compile_resources(
@@ -374,6 +374,7 @@ libdazzle = library(
soversion: soversion,
version: libversion,
install: true,
+ install_dir: libdir,
)
libdazzle_dep = declare_dependency(
@@ -427,11 +428,12 @@ pkgg = import('pkgconfig')
pkgg.generate(
libraries: [libdazzle],
- subdirs: 'libdazzle-@0@'.format(apiversion),
+ subdirs: libdazzle_header_subdir,
version: meson.project_version(),
name: 'Dazzle',
filebase: 'libdazzle-@0@'.format(apiversion),
description: 'Razzle Dazzle for Gtk+ 3.x applications',
requires: 'gtk+-3.0',
+ install_dir: join_paths(libdir, 'pkgconfig'),
)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]