X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fcross.cc;h=0bcb31e3e78e99eeb5f7a5d7628142a51a47a642;hb=2ec879dfc354c1aa95f78e9f264f2487fd2688ae;hp=d84c17c55b25318ef5b32a0a06eda8ee23ac1d16;hpb=c6c082c4a8016f85ba4207f4b8ccee1d5770e4a4;p=dcpomatic.git diff --git a/src/lib/cross.cc b/src/lib/cross.cc index d84c17c55..0bcb31e3e 100644 --- a/src/lib/cross.cc +++ b/src/lib/cross.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2014 Carl Hetherington + Copyright (C) 2012-2015 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,11 +17,11 @@ */ -#include -#include #include "cross.h" #include "compose.hpp" #include "log.h" +#include "exceptions.h" +#include #ifdef DCPOMATIC_LINUX #include #include @@ -42,7 +42,7 @@ #include #include #endif -#include "exceptions.h" +#include #include "i18n.h" @@ -151,6 +151,28 @@ app_contents () } #endif +boost::filesystem::path +shared_path () +{ +#ifdef DCPOMATIC_LINUX + char const * p = getenv ("DCPOMATIC_LINUX_SHARE_PREFIX"); + if (p) { + return p; + } + return boost::filesystem::canonical (LINUX_SHARE_PREFIX); +#endif +#ifdef DCPOMATIC_WINDOWS + wchar_t dir[512]; + GetModuleFileName (GetModuleHandle (0), dir, sizeof (dir)); + PathRemoveFileSpec (dir); + boost::filesystem::path path = dir; + return path.parent_path(); +#endif +#ifdef DCPOMATIC_OSX + return app_contents() / "Resources"; +#endif +} + void run_ffprobe (boost::filesystem::path content, boost::filesystem::path out, shared_ptr log) {