summaryrefslogtreecommitdiff
path: root/src/porting.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-01-08 17:34:25 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-01-08 17:34:25 +0200
commit9fbb0889a7a73d3e879f76aa4c398dcb78c532ed (patch)
tree9169e3659112cc35166c2122aaa4ef07c5366415 /src/porting.cpp
parent426c206d7e08ac4c5b45ec51450d02aa26b8eebd (diff)
downloadminetest-9fbb0889a7a73d3e879f76aa4c398dcb78c532ed.tar.gz
minetest-9fbb0889a7a73d3e879f76aa4c398dcb78c532ed.tar.bz2
minetest-9fbb0889a7a73d3e879f76aa4c398dcb78c532ed.zip
CMake stuff works now on linux and windows... and should be possible to make to work on OS X.
Diffstat (limited to 'src/porting.cpp')
-rw-r--r--src/porting.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/porting.cpp b/src/porting.cpp
index bff865c53..6686a657e 100644
--- a/src/porting.cpp
+++ b/src/porting.cpp
@@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
*/
#include "porting.h"
+#include "config.h"
namespace porting
{
@@ -103,7 +104,9 @@ void initializePaths()
path_userdata = std::string("../");
#endif
-#else
+
+#else // RUN_IN_PLACE
+
/*
Use platform-specific paths otherwise
*/
@@ -127,6 +130,7 @@ void initializePaths()
// Use "./bin/../data"
path_data = std::string(buf) + "/../data";
+ //path_data = std::string(buf) + "/../share/" + APPNAME;
// Use "C:\Documents and Settings\user\Application Data\<APPNAME>"
len = GetEnvironmentVariable("APPDATA", buf, buflen);
@@ -137,20 +141,23 @@ void initializePaths()
Linux
*/
#elif defined(linux)
+ #include <unistd.h>
- path_userdata = std::string("~/.") + APPNAME;
- path_data = std::string("/usr/share/") + APPNAME;
+ path_userdata = std::string(getenv("HOME")) + "/." + APPNAME;
+ path_data = std::string(INSTALL_PREFIX) + "/share/" + APPNAME;
/*
OS X
*/
#elif defined(__APPLE__)
+ #include <unistd.h>
- path_userdata = std::string("~/Library/Application Support/") + APPNAME;
+ path_userdata = std::string(getenv("HOME")) + "/Library/Application Support/" + APPNAME;
path_data = std::string("minetest-mac.app/Contents/Resources/data/");
#endif
-#endif
+
+#endif // RUN_IN_PLACE
dstream<<"path_data = "<<path_data<<std::endl;
dstream<<"path_userdata = "<<path_userdata<<std::endl;