From 79eeba22101e6ae87a3f229aebc127ccbcf047ed Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tobias=20Gl=C3=A4=C3=9Fer?= Date: Fri, 6 Aug 2004 12:10:54 +0000 Subject: [PATCH] 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 --- lib/app/setup.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 -- 2.11.0