summaryrefslogtreecommitdiff
blob: e90617c38ea77a6e10c8dfed20acf3f32793df53 (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
60
61
62
63
64
65
66
67
68
69
70
71
From 03581f45a3563d3d79075fe0e85e6fb52e864b76 Mon Sep 17 00:00:00 2001
From: William Breathitt Gray <vilhelm.gray@gmail.com>
Date: Sat, 4 Apr 2020 22:38:26 -0400
Subject: [PATCH] Fix odamex.wad build flow

The odamex.wad file should be built in the proper build directory;
building in the source tree confuses CMake and causes it to attempt to
rebuild a second time. This patch also removes odawad dependency for the
Odamex client and server executables.
---
 wad/CMakeLists.txt | 40 ++++++++++++++++++++++------------------
 1 file changed, 22 insertions(+), 18 deletions(-)

diff --git a/wad/CMakeLists.txt b/wad/CMakeLists.txt
index c09b0d1a..349ce0df 100644
--- a/wad/CMakeLists.txt
+++ b/wad/CMakeLists.txt
@@ -4,28 +4,32 @@ find_program(DEUTEX deutex)
 if(DEUTEX)
 	message("Found DeuTex: ${DEUTEX}")
 
-	file(REMOVE odamex.wad)
-	add_custom_command(OUTPUT odamex.wad
-		COMMAND ${DEUTEX} -rgb 0 255 255 -doom2 bootstrap -build wadinfo.txt odamex.wad
+	add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/odamex.wad
+		COMMAND ${DEUTEX} -rgb 0 255 255 -doom2 bootstrap -build wadinfo.txt ${CMAKE_CURRENT_BINARY_DIR}/odamex.wad
 		WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+		BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/odamex.wad
 		VERBATIM)
 
-	add_custom_target(odawad DEPENDS odamex.wad)
+	add_custom_target(odawad ALL
+		DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/odamex.wad)
 
-	if(BUILD_CLIENT)
-	  add_dependencies(odamex odawad)
+	if(WIN32)
+		install(FILES ${CMAKE_CURRENT_BINARY_DIR}/odamex.wad
+			DESTINATION .
+			COMPONENT common)
+	else()
+		install(FILES ${CMAKE_CURRENT_BINARY_DIR}/odamex.wad
+			DESTINATION ${CMAKE_INSTALL_DATADIR}/odamex
+			COMPONENT common)
 	endif()
-	if(BUILD_SERVER)
-	  add_dependencies(odasrv odawad)
-	endif()
-endif()
-
-if(WIN32)
-	install(FILES odamex.wad
-		DESTINATION .
-		COMPONENT common)
 else()
-	install(FILES odamex.wad
-		DESTINATION ${CMAKE_INSTALL_DATADIR}/odamex
-		COMPONENT common)
+	if(WIN32)
+		install(FILES odamex.wad
+			DESTINATION .
+			COMPONENT common)
+	else()
+		install(FILES odamex.wad
+			DESTINATION ${CMAKE_INSTALL_DATADIR}/odamex
+			COMPONENT common)
+	endif()
 endif()
-- 
2.26.0