Permalink
Browse files

Now getting resource directory from cmake instead of hardcode; also e…

…nabled RESDIR for Release builds
  • Loading branch information...
1 parent 2ee3f96 commit cf2ebd92a51ac4a0a88a3d643dde07f6b5369e1e @noway421 noway421 committed May 8, 2014
Showing with 5 additions and 7 deletions.
  1. +3 −0 OpenSpades.h.in
  2. +2 −7 Sources/Gui/Main.cpp
View
@@ -20,3 +20,6 @@
#cmakedefine RESDIR_DEFINED
#define RESDIR "${RESDIR}"
+
+#define CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}"
+#define OPENSPADES_INSTALL_RESOURCES "${OPENSPADES_INSTALL_RESOURCES}"
@@ -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";
@@ -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

0 comments on commit cf2ebd9

Please sign in to comment.