X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fporting.cpp;h=39b2c570587d2f083c2c9752935931321b43640d;hb=36af9bb027ed6846227282587e3414ea3d30f6c5;hp=ff8cb3862276f3c1158b8336839dc7e9643221b7;hpb=7985d746f97ce1b37b6ca48a8a3e7ed70d02e4b0;p=dragonfireclient.git diff --git a/src/porting.cpp b/src/porting.cpp index ff8cb3862..39b2c5705 100644 --- a/src/porting.cpp +++ b/src/porting.cpp @@ -154,10 +154,10 @@ void initializePaths() /* OS X */ - #elif defined(__APPLE__) + #elif defined(__APPLE__) || defined(__FreeBSD__) //TODO: Get path of executable. This assumes working directory is bin/ - dstream<<"WARNING: Relative path not properly supported on OS X" + dstream<<"WARNING: Relative path not properly supported on OS X and FreeBSD" <" + // Use "C:\Documents and Settings\user\Application Data\" len = GetEnvironmentVariable("APPDATA", buf, buflen); assert(len < buflen); - path_userdata = std::string(buf) + "/" + APPNAME; + path_userdata = std::string(buf) + "/" + PROJECT_NAME; /* Linux @@ -209,15 +209,15 @@ void initializePaths() pathRemoveFile(buf, '/'); - path_data = std::string(buf) + "/../share/" + APPNAME; - //path_data = std::string(INSTALL_PREFIX) + "/share/" + APPNAME; + path_data = std::string(buf) + "/../share/" + PROJECT_NAME; + //path_data = std::string(INSTALL_PREFIX) + "/share/" + PROJECT_NAME; if (!fs::PathExists(path_data)) { dstream<<"WARNING: data path " << path_data << " not found!"; path_data = std::string(buf) + "/../data"; dstream<<" Trying " << path_data << std::endl; } - path_userdata = std::string(getenv("HOME")) + "/." + APPNAME; + path_userdata = std::string(getenv("HOME")) + "/." + PROJECT_NAME; /* OS X @@ -243,7 +243,12 @@ void initializePaths() } CFRelease(resources_url); - path_userdata = std::string(getenv("HOME")) + "/Library/Application Support/" + APPNAME; + path_userdata = std::string(getenv("HOME")) + "/Library/Application Support/" + PROJECT_NAME; + + #elif defined(__FreeBSD__) + + path_data = std::string(INSTALL_PREFIX) + "/share/" + PROJECT_NAME; + path_userdata = std::string(getenv("HOME")) + "/." + PROJECT_NAME; #endif