From 9fbb0889a7a73d3e879f76aa4c398dcb78c532ed Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sat, 8 Jan 2011 17:34:25 +0200 Subject: CMake stuff works now on linux and windows... and should be possible to make to work on OS X. --- src/porting.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/porting.cpp') 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\" len = GetEnvironmentVariable("APPDATA", buf, buflen); @@ -137,20 +141,23 @@ void initializePaths() Linux */ #elif defined(linux) + #include - 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 - 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 = "<