13
0

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
This commit is contained in:
Carl Hetherington 2011-10-22 21:46:46 +00:00
parent e549e8f82c
commit 4c2f9dd11b
4 changed files with 14 additions and 1 deletions

View File

@ -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

View File

@ -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

View File

@ -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'

View File

@ -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)