Navigation Menu

Skip to content

Commit

Permalink
Fix application context paths for mac build
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Dec 24, 2019
1 parent 37814e4 commit d13b709
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions radiant/modulesystem/ApplicationContextImpl.cpp
Expand Up @@ -31,39 +31,40 @@ std::string ApplicationContextImpl::getApplicationPath() const

std::string ApplicationContextImpl::getLibraryPath() const
{
#if defined(POSIX)
#if defined(PKGLIBDIR) && !defined(ENABLE_RELOCATION)
#if defined(__APPLE__)
return _appPath;
#elif defined(POSIX)
# if defined(PKGLIBDIR) && !defined(ENABLE_RELOCATION)
return PKGLIBDIR;
#else
# else
return _appPath + "../lib/darkradiant/";
#endif
# endif
#else // !defined(POSIX)
return _appPath;
#endif
}

std::string ApplicationContextImpl::getRuntimeDataPath() const
{
#if defined(POSIX)
#if defined(PKGDATADIR) && !defined(ENABLE_RELOCATION)
return std::string(PKGDATADIR) + "/";
#else
return _appPath + "../share/darkradiant/";
#endif
#elif defined(__APPLE__)
#if defined(__APPLE__)
// The Resources are in the Bundle folder Contents/Resources/, whereas the
// application binary is located in Contents/MacOS/
std::string path = getApplicationPath() + "../Resources/";

// When launching the app from Xcode, the Resources/ folder
// is next to the binary
if (!fs::exists(path))
{
path = getApplicationPath() + "Resources/";
}

return path;
#else
#elif defined(POSIX)
# if defined(PKGDATADIR) && !defined(ENABLE_RELOCATION)
return std::string(PKGDATADIR) + "/";
# else
return _appPath + "../share/darkradiant/";
# endif
return getApplicationPath();
#endif
}
Expand Down

0 comments on commit d13b709

Please sign in to comment.