From 4c2f9dd11b48b3fc5ae532fe3457dd844b7df3e8 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 22 Oct 2011 21:46:46 +0000 Subject: [PATCH] Add function to recover a full path from something like '.' git-svn-id: svn://localhost/ardour2/branches/3.0@10284 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/pbd/filesystem.cc | 10 ++++++++++ libs/pbd/pbd/filesystem.h | 2 ++ libs/pbd/wscript | 2 +- wscript | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/libs/pbd/filesystem.cc b/libs/pbd/filesystem.cc index 886cd24d99..661e21cbd5 100644 --- a/libs/pbd/filesystem.cc +++ b/libs/pbd/filesystem.cc @@ -21,6 +21,8 @@ #include #include +#include + #include #include @@ -222,6 +224,14 @@ extension (const path & p) } +/** Take a (possibly) relative path and make it absolute */ +path +get_absolute_path (const path & p) +{ + Glib::RefPtr f = Gio::File::create_for_path (p.to_string ()); + return f->get_path (); +} + } // namespace sys } // namespace PBD diff --git a/libs/pbd/pbd/filesystem.h b/libs/pbd/pbd/filesystem.h index 7de9bda00f..a20efaf613 100644 --- a/libs/pbd/pbd/filesystem.h +++ b/libs/pbd/pbd/filesystem.h @@ -197,6 +197,8 @@ std::string basename (const path& p); */ std::string extension (const path& p); +path get_absolute_path (const path &); + } // namespace sys } // namespace PBD diff --git a/libs/pbd/wscript b/libs/pbd/wscript index 577e902532..5cd2050303 100644 --- a/libs/pbd/wscript +++ b/libs/pbd/wscript @@ -115,7 +115,7 @@ def build(bld): obj.includes = ['.'] obj.name = 'libpbd' obj.target = 'pbd' - obj.uselib = 'GLIBMM SIGCPP XML UUID SNDFILE' + obj.uselib = 'GLIBMM SIGCPP XML UUID SNDFILE GIOMM' if sys.platform == 'darwin': TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cc'] obj.source += 'cocoa_open_uri.mm' diff --git a/wscript b/wscript index 045c606ac9..cc0c7d51ce 100644 --- a/wscript +++ b/wscript @@ -511,6 +511,7 @@ def configure(conf): autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD', atleast_version='2.2') autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.14.0') autowaf.check_pkg(conf, 'sndfile', uselib_store='SNDFILE', atleast_version='1.0.18') + autowaf.check_pkg(conf, 'giomm-2.4', uselib_store='GIOMM', atleast_version='2.2') for i in children: sub_config_and_use(conf, i)