Skip to content

Commit

Permalink
Now getting resource directory from cmake instead of hardcode; also e…
Browse files Browse the repository at this point in the history
…nabled RESDIR for Release builds
  • Loading branch information
noway committed May 8, 2014
1 parent 2ee3f96 commit cf2ebd9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
3 changes: 3 additions & 0 deletions OpenSpades.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@

#cmakedefine RESDIR_DEFINED
#define RESDIR "${RESDIR}"

#define CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}"
#define OPENSPADES_INSTALL_RESOURCES "${OPENSPADES_INSTALL_RESOURCES}"
9 changes: 2 additions & 7 deletions Sources/Gui/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,12 +389,7 @@ int main(int argc, char ** argv)
spades::FileManager::AddFileSystem
(new spades::DirectoryFileSystem("./Resources", false));

spades::FileManager::AddFileSystem
(new spades::DirectoryFileSystem("/usr/local/share/games/openspades/Resources", false));

spades::FileManager::AddFileSystem
(new spades::DirectoryFileSystem("/usr/share/games/openspades/Resources", false));

spades::FileManager::AddFileSystem(new spades::DirectoryFileSystem(CMAKE_INSTALL_PREFIX "/" OPENSPADES_INSTALL_RESOURCES, false));

std::string xdg_data_home = home+"/.local/share";

Expand Down Expand Up @@ -480,7 +475,7 @@ int main(int argc, char ** argv)
}

// register resource directory specified by Makefile (or something)
#if defined(RESDIR_DEFINED) && !NDEBUG
#if defined(RESDIR_DEFINED)
spades::FileManager::AddFileSystem(new spades::DirectoryFileSystem(RESDIR, false));
#endif

Expand Down

0 comments on commit cf2ebd9

Please sign in to comment.