From: Tobias Gläßer Date: Fri, 6 Aug 2004 12:10:54 +0000 (+0000) Subject: The right (source) data directory should now be found whether you use libtool to... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=79eeba22101e6ae87a3f229aebc127ccbcf047ed;p=supertux.git The right (source) data directory should now be found whether you use libtool to link your application against the SuperTux library or not. SVN-Revision: 1716 --- diff --git a/lib/app/setup.cpp b/lib/app/setup.cpp index 5ddcb0198..f1d40815b 100644 --- a/lib/app/setup.cpp +++ b/lib/app/setup.cpp @@ -297,16 +297,21 @@ void Setup::directories(void) } else { - std::string exedir = std::string(dirname(exe_file)) + "/"; - - datadir = exedir + "../../data"; // SuperTux run from source dir + std::string exedir = std::string(dirname(exe_file)) + "/"; + + datadir = exedir + "../data"; // SuperTux run from source dir if (access(datadir.c_str(), F_OK) != 0) { + datadir = exedir + "../../data"; //SuperTux run from source dir (with libtool script) + + if (access(datadir.c_str(), F_OK) != 0) + { datadir = exedir + "../share/" + package_symbol_name; // SuperTux run from PATH if (access(datadir.c_str(), F_OK) != 0) { // If all fails, fall back to compiled path datadir = DATA_PREFIX; } + } } } #else