1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3aef3ba1c..051afed10 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -75,7 +75,6 @@ CMAKE_DEPENDENT_OPTION(USE_COCOA "Use Apple Cocoa widgets." ON "APPLE" O
CMAKE_DEPENDENT_OPTION(USE_WIN32_WINDOWS "Use Microsoft Desktop App User Interface widgets." ON "WIN32" OFF)
CMAKE_DEPENDENT_OPTION(USE_SDL_MAINLOOP "Use SDL to create windows etc. Qt editor." ON "NOT USE_COCOA AND NOT USE_WIN32_WINDOWS AND NOT HEADLESS_ONLY" OFF)
option(WITH_AUTOMATIC_UPDATE "Automatic updates are downloaded from the project website." OFF)
-CMAKE_DEPENDENT_OPTION(WITH_APPDIR_INSTALLATION "Install into an AppDir" OFF "UNIX AND NOT APPLE AND WITH_AUTOMATIC_UPDATE" ON)
option(HEADLESS_ONLY "Only build headless parts. Somewhat reduces dependencies. (still needs libpng because that one's small and hard to remove.) Only tested with make/gcc/linux." OFF)
option(C4GROUP_TOOL_ONLY "Only build c4group binary." OFF)
@@ -156,6 +155,10 @@ if(WIN32 AND MINGW)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--nxcompat -Wl,--dynamicbase")
endif()
+if(UNIX)
+ add_definitions("-DOC_SYSTEM_DATA_DIR=\"${CMAKE_INSTALL_PREFIX}/share/games/openclonk\"")
+endif()
+
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fobjc-arc -headerpad_max_install_names")
endif()
@@ -1435,11 +1438,7 @@ endif()
# Don't allow installation for WITH_AUTOMATIC_UPDATE because otherwise
# the installed binary wouldn't find its game data in the system data path.
IF(WITH_AUTOMATIC_UPDATE)
- if(WITH_APPDIR_INSTALLATION)
- INSTALL(CODE "MESSAGE(\"WITH_APPDIR_INSTALLATION is enabled, installation will create an AppDir\")")
- else()
- INSTALL(CODE "MESSAGE(SEND_ERROR \"Installation is only supported for WITH_AUTOMATIC_UPDATE disabled\")")
- endif()
+ INSTALL(CODE "MESSAGE(SEND_ERROR \"Installation is only supported for WITH_AUTOMATIC_UPDATE disabled\")")
ENDIF()
if(NOT C4GROUP_TOOL_ONLY)
@@ -1583,12 +1582,7 @@ if(NOT HEADLESS_ONLY AND NOT C4GROUP_TOOL_ONLY)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/openclonk.appdata.xml DESTINATION share/appdata)
# Install binaries
- if(WITH_APPDIR_INSTALLATION)
- # AppDir expects binaries in /usr/bin
- install(TARGETS openclonk DESTINATION bin)
- else()
- install(TARGETS openclonk DESTINATION games)
- endif()
+ install(TARGETS openclonk DESTINATION games)
else()
install(TARGETS openclonk
BUNDLE DESTINATION .
diff --git a/config.h.cmake b/config.h.cmake
index e2cec4c69..5279d2930 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -90,13 +90,12 @@
/* Enable automatic update system */
#cmakedefine WITH_AUTOMATIC_UPDATE 1
-#cmakedefine WITH_APPDIR_INSTALLATION 1
/* Select an audio provider */
#define AUDIO_TK AUDIO_TK_${Audio_TK_UPPER}
#else
#define AUDIO_TK AUDIO_TK_NONE
-#endif // USE_CONSOLE
+#endif
#define AUDIO_TK_NONE 0
#define AUDIO_TK_OPENAL 1
@@ -105,12 +104,5 @@
/* Include OpenAL extensions (alext.h) for sound modifiers */
#cmakedefine HAVE_ALEXT 1
-/* Path to data directory */
-#ifdef WITH_APPDIR_INSTALLATION
-#define OC_SYSTEM_DATA_DIR "../share/games/openclonk"
-#else
-#define OC_SYSTEM_DATA_DIR "${CMAKE_INSTALL_PREFIX}/share/games/openclonk"
-#endif
-
/* Path to /proc/self/exe (Linux) or equivalent */
#cmakedefine PROC_SELF_EXE "${PROC_SELF_EXE}"
diff --git a/src/config/C4Config.cpp b/src/config/C4Config.cpp
index 50bc001bd..d310c38ce 100644
--- a/src/config/C4Config.cpp
+++ b/src/config/C4Config.cpp
@@ -476,10 +476,6 @@ void C4ConfigGeneral::DeterminePaths()
SCopy(ExePath.getMData(),SystemDataPath);
#elif defined(__APPLE__)
SCopy(::Application.GetGameDataPath().c_str(),SystemDataPath);
-#elif defined(WITH_AUTOMATIC_UPDATE) && defined(WITH_APPDIR_INSTALLATION)
- // AppDir: layout like normal unix installation, but relative to executable.
- auto str = FormatString("%s%s", ExePath.getMData(), OC_SYSTEM_DATA_DIR);
- SCopy(str.getMData(), SystemDataPath);
#elif defined(WITH_AUTOMATIC_UPDATE)
// WITH_AUTOMATIC_UPDATE builds are our tarball releases and
// development snapshots, i.e. where the game data is at the
|