Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ option(CURSES "Build curses version." "ON")
option(SOUND "Support for in-game sounds & music." "OFF")
option(BACKTRACE "Support for printing stack backtraces on crash" "ON")
option(LIBBACKTRACE "Print backtrace with libbacktrace." "OFF")
option(USE_HOME_DIR "Use user's home directory for save files." "ON")
option(USE_XDG_DIR "Use XDG directories for save and config files." "OFF")
option(USE_HOME_DIR "Use user's home directory for save and config files." "ON")
option(USE_PREFIX_DATA_DIR "Use UNIX system directories for game data in release build." "ON")
option(LOCALIZE "Support for language localizations. Also enable UTF support." "ON")
option(LANGUAGES "Compile localization files for specified languages." "")
Expand Down Expand Up @@ -186,6 +187,11 @@ if (TILES)
set(CURSES OFF)
endif ()

# Can't use both home and xdg directories
if (USE_XDG_DIR)
set(USE_HOME_DIR OFF)
endif ()

# Set build types and display info
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set(RELEASE 0)
Expand Down Expand Up @@ -229,6 +235,7 @@ message(STATUS "CURSES : ${CURSES}")
message(STATUS "SOUND : ${SOUND}")
message(STATUS "BACKTRACE : ${BACKTRACE}")
message(STATUS "LOCALIZE : ${LOCALIZE}")
message(STATUS "USE_XDG_DIR : ${USE_XDG_DIR}")
message(STATUS "USE_HOME_DIR : ${USE_HOME_DIR}")
message(STATUS "LANGUAGES : ${LANGUAGES}")
message(STATUS "See doc/COMPILING/COMPILING-CMAKE.md for details and more info --")
Expand Down Expand Up @@ -412,6 +419,10 @@ if (USE_HOME_DIR)
add_definitions(-DUSE_HOME_DIR)
endif ()

if (USE_XDG_DIR)
add_definitions(-DUSE_XDG_DIR)
endif ()

find_program(CCACHE_FOUND ccache)
if (CCACHE_FOUND AND CATA_CCACHE)
set(CMAKE_C_COMPILER_LAUNCHER ccache)
Expand Down
3 changes: 2 additions & 1 deletion doc/COMPILING/COMPILING-CMAKE.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@ $ cmake -DOPTION_NAME1=option_value1 [-DOPTION_NAME2=option_value2 [...]]
* `CURSES=<boolean>`: Build curses version.
* `TILES=<boolean>`: Build graphical tileset version.
* `SOUND=<boolean>`: Support for in-game sounds & music.
* `USE_HOME_DIR=<boolean>`: Use user's home directory for save files.
* `USE_XDG_DIR=<boolean>`: Use user's XDG directories for save and config files.
* `USE_HOME_DIR=<boolean>`: Use user's home directory for save and config files.
* `USE_PREFIX_DATA_DIR=<boolean>`: Use UNIX system directories for game data in release build.
* `LOCALIZE=<boolean>`: Support for language localizations. Also enable UTF support.
* `LANGUAGES=<str>`: Compile localization files for specified languages. Example:
Expand Down
2 changes: 1 addition & 1 deletion doc/COMPILING/COMPILING.md
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ The Cataclysm source is compiled using `make`.
* `RELEASE=1` build an optimized release version; omit for debug build.
* `CLANG=1` build with [Clang](http://clang.llvm.org/), the compiler that's included with the latest Command Line Tools for Xcode; omit to build using gcc/g++. This is enabled by default.
* `MACPORTS=1` build against dependencies installed via Macports, currently only `gettext` and `ncurses`.
* `USE_HOME_DIR=1` places user files (config, saves, graveyard, etc) in the user's home directory. For curses builds, this is `/Users/<user>/.cataclysm-dda`, for SDL builds it is `/Users/<user>/Library/Application Support/Cataclysm`.
* `USE_HOME_DIR=1` places user files (config, saves, graveyard, etc) in the user's home directory. For curses builds, this is `/Users/<user>/.cataclysm-dda`, for OSX builds it is `/Users/<user>/Library/Application Support/Cataclysm`.
* `DEBUG_SYMBOLS=1` retains debug symbols when building an optimized release binary, making it easy for developers to spot the crash site.

In addition to the options above, there is an `app` make target which will package the tiles build into `Cataclysm.app`, a complete tiles build in a Mac application that can run without Terminal.
Expand Down