Skip to content

Commit

Permalink
Merge pull request #490 from freepotion/home-state-dir
Browse files Browse the repository at this point in the history
USE_HOME_FOR_STATE_DIR option added
  • Loading branch information
J.W committed Nov 5, 2018
2 parents a924e15 + be0d84c commit 2b27cea
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
add_definitions(-DIVAN_VERSION="${PROJECT_VERSION}" -DUSE_SDL)

option(BUILD_MAC_APP "Build standalone application for MacOS" OFF)
option(USE_HOME_FOR_STATE_DIR "Statedir will be /.ivan/ in current user's homedir" OFF)

if(UNIX)
add_definitions(-DUNIX)
include(GNUInstallDirs)
if(USE_HOME_FOR_STATE_DIR)
add_definitions(-DUSE_HOME_FOR_STATE_DIR)
endif(USE_HOME_FOR_STATE_DIR)

if(BUILD_MAC_APP)
install(DIRECTORY Graphics Script Music Sound DESTINATION "ivan")
Expand Down
3 changes: 3 additions & 0 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ If config options toggle is too fast, you can add this flag '-DFELIST_WAITKEYUP'
like this: CMAKE_CXX_FLAGS="-DFELIST_WAITKEYUP -DWIZARD" (you may chose what
flags to add independently of each other).

To store score and bones' files at user $HOME/.ivan/ path, you can turn on cmake
option 'USE_HOME_FOR_STATE_DIR', like this: "-DUSE_HOME_FOR_STATE_DIR=ON".

--------------------------------------

Under DOS:
Expand Down
3 changes: 3 additions & 0 deletions Main/Source/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5191,6 +5191,9 @@ festring game::GetDataDir()

festring game::GetStateDir()
{
#ifdef USE_HOME_FOR_STATE_DIR
return GetHomeDir();
#endif
#ifdef UNIX
#ifdef MAC_APP
return GetHomeDir();
Expand Down

0 comments on commit 2b27cea

Please sign in to comment.