summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt3
-rw-r--r--src/app/app.cpp5
-rw-r--r--src/common/config.h.cmake2
3 files changed, 10 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6deed31..d0d1416 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -156,6 +156,9 @@ option(ASSERTS "Enable assert()s" ON)
# Development build can be enabled/disabled regardless of build type
option(DEV_BUILD "Enable development build (enables some debugging tools, local setting paths, etc.)" OFF)
+# Portable build - load all data from current directory
+option(PORTABLE "Portable build" OFF)
+
# Building tests can be enabled/disabled
option(TESTS "Build tests" OFF)
diff --git a/src/app/app.cpp b/src/app/app.cpp
index ce6a6b5..adc7ea3 100644
--- a/src/app/app.cpp
+++ b/src/app/app.cpp
@@ -151,8 +151,13 @@ CApplication::CApplication()
m_mouseButtonsState = 0;
m_trackedKeys = 0;
+ #ifdef PORTABLE
+ m_dataPath = "./data";
+ m_langPath = "./lang";
+ #else
m_dataPath = GetSystemUtils()->GetDataPath();
m_langPath = GetSystemUtils()->GetLangPath();
+ #endif
m_runSceneName = "";
m_runSceneRank = 0;
diff --git a/src/common/config.h.cmake b/src/common/config.h.cmake
index 98ccefe..44c1085 100644
--- a/src/common/config.h.cmake
+++ b/src/common/config.h.cmake
@@ -24,6 +24,8 @@
#define SDL_MAIN_FUNC main
#endif
+#cmakedefine PORTABLE @PORTABLE@
+
#define COLOBOT_VERSION "@COLOBOT_VERSION_FULL@"
#define COLOBOT_CODENAME "@COLOBOT_VERSION_CODENAME@"
#define COLOBOT_FULLNAME "Colobot @COLOBOT_VERSION_CODENAME@"