#include "debug.h"
#include "filesys.h"
#include "log.h"
+#include "utility_string.h"
#ifdef __APPLE__
#include "CoreFoundation/CoreFoundation.h"
path[i] = 0;
}
+bool detectMSVCBuildDir(char *c_path)
+{
+ std::string path(c_path);
+ const char *ends[] = {"bin\\Release", "bin\\Build", NULL};
+ return (removeStringEnd(path, ends) != "");
+}
+
void initializePaths()
{
#ifdef RUN_IN_PLACE
len = GetModuleFileName(GetModuleHandle(NULL), buf, buflen);
assert(len < buflen);
pathRemoveFile(buf, '\\');
-
- path_share = std::string(buf) + "\\..";
- path_user = std::string(buf) + "\\..";
+
+ if(detectMSVCBuildDir(buf)){
+ infostream<<"MSVC build directory detected"<<std::endl;
+ path_share = std::string(buf) + "\\..\\..";
+ path_user = std::string(buf) + "\\..\\..";
+ }
+ else{
+ path_share = std::string(buf) + "\\..";
+ path_user = std::string(buf) + "\\..";
+ }
/*
Linux