summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-10-22 21:46:46 +0000
committerCarl Hetherington <carl@carlh.net>2011-10-22 21:46:46 +0000
commit4c2f9dd11b48b3fc5ae532fe3457dd844b7df3e8 (patch)
treee13f9076be88cda8e5244c7ebb5e824861f522bd
parente549e8f82c151db4ba6cd95ed5045c530453900f (diff)
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
-rw-r--r--libs/pbd/filesystem.cc10
-rw-r--r--libs/pbd/pbd/filesystem.h2
-rw-r--r--libs/pbd/wscript2
-rw-r--r--wscript1
4 files changed, 14 insertions, 1 deletions
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 <glib.h>
#include <glib/gstdio.h>
+#include <giomm/file.h>
+
#include <cerrno>
#include <fstream>
@@ -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<Gio::File> 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)