summaryrefslogtreecommitdiff
blob: 3eb6953cfe8555428bbdc466be91d9a860ceb859 (plain)
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
commit 3a5209e2595e459a31c111f6040dbac347df1967
Author: hasufell <hasufell@gentoo.org>
Date:   Wed Jul 31 03:38:10 2013 +0200

    add odamex.wad install destination to wad search path

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ca01bba..83a0e30 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,6 +12,16 @@ option(BUILD_SERVER "Build server target" 1)
 option(BUILD_MASTER "Build master server target" 1)
 cmake_dependent_option( BUILD_ODALAUNCH "Build odalaunch target" 1 BUILD_CLIENT 0 )
 cmake_dependent_option( ENABLE_PORTMIDI "Enable portmidi support" 1 BUILD_CLIENT 0 )
+
+configure_file (
+  "${PROJECT_SOURCE_DIR}/config.h.in"
+  "${PROJECT_BINARY_DIR}/config.h"
+  )
+
+include_directories(
+	${PROJECT_BINARY_DIR}
+)
+
 set(PROJECT_VERSION 0.6.4)
 set(PROJECT_COPYRIGHT "2006-2013")
 
diff --git a/common/d_main.cpp b/common/d_main.cpp
index 010bdcb..6dc2e5f 100644
--- a/common/d_main.cpp
+++ b/common/d_main.cpp
@@ -23,6 +23,7 @@
 //-----------------------------------------------------------------------------
 
 #include "version.h"
+#include "config.h"
 
 #include <sstream>
 #include <string>
@@ -493,6 +494,7 @@ static std::string BaseFileSearch(std::string file, std::string ext = "", std::s
 	D_AddSearchDir(dirs, getenv("DOOMWADDIR"), separator);
 	D_AddSearchDir(dirs, getenv("DOOMWADPATH"), separator);
 	D_AddSearchDir(dirs, getenv("HOME"), separator);
+	D_AddSearchDir(dirs, CMAKE_WADDIR, separator);
 
 	// [AM] Search additional paths based on platform
 	D_AddPlatformSearchDirs(dirs);
diff --git a/config.h.in b/config.h.in
new file mode 100644
index 0000000..e91b3a6
--- /dev/null
+++ b/config.h.in
@@ -0,0 +1,6 @@
+#ifndef CONFIG_H
+#define CONFIG_H
+
+#define CMAKE_WADDIR "@CMAKE_INSTALL_DATADIR@"
+
+#endif