File: 04_use_system_tinyxml.patch

package info (click to toggle)
blobby 1.1.1%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,944 kB
  • sloc: cpp: 22,442; xml: 779; python: 56; makefile: 3
file content (94 lines) | stat: -rw-r--r-- 2,541 bytes parent folder | download | duplicates (2)
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
Description: Use system tinyxml library instead of building a local copy
Author: Felix Geyer <fgeyer@debian.org>

--- a/src/FileRead.cpp
+++ b/src/FileRead.cpp
@@ -29,7 +29,7 @@
 #include <boost/crc.hpp>
 #include <boost/algorithm/string.hpp>
 
-#include "tinyxml2.h"
+#include <tinyxml2.h>
 #include <lua.hpp>
 
 
--- a/src/replays/ReplayRecorder.cpp
+++ b/src/replays/ReplayRecorder.cpp
@@ -27,7 +27,7 @@
 
 #include <boost/algorithm/string/trim_all.hpp>
 
-#include "tinyxml2.h"
+#include <tinyxml2.h>
 
 #include "raknet/BitStream.h"
 
--- a/src/TextManager.cpp
+++ b/src/TextManager.cpp
@@ -26,7 +26,7 @@
 #include <algorithm>
 #include <set>
 
-#include "tinyxml2.h"
+#include <tinyxml2.h>
 
 #include "FileRead.h"
 
--- a/src/UserConfig.cpp
+++ b/src/UserConfig.cpp
@@ -27,7 +27,7 @@
 #include <limits>
 #include <utility>
 
-#include "tinyxml2.h"
+#include <tinyxml2.h>
 
 #include "Global.h"
 #include "FileRead.h"
--- a/src/state/NetworkSearchState.cpp
+++ b/src/state/NetworkSearchState.cpp
@@ -36,7 +36,7 @@
 #include "blobnet/layer/Http.hpp"
 #include "blobnet/exception/HttpException.hpp"
 
-#include "tinyxml2.h"
+#include <tinyxml2.h>
 
 #include "NetworkState.h"
 #include "LobbyStates.h"
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -85,6 +85,8 @@
 find_package(Boost REQUIRED)
 find_package(OpenGL)
 find_package(Lua REQUIRED)
+find_package(PkgConfig)
+pkg_check_modules(TINYXML2 REQUIRED tinyxml2)
 add_subdirectory(raknet)
 add_subdirectory(blobnet)
 
@@ -101,7 +103,7 @@
 	add_definitions("-DBLOBBY_DATA_DIR=\"${CMAKE_INSTALL_PREFIX}/share/blobby\"")
 endif()
 
-set(BLOBBY_COMMON_LIBS ${LUA_LIBRARIES} blobnet::blobnet tinyxml2::tinyxml2 PhysFS::PhysFS SDL2::SDL2main SDL2::SDL2 Boost::boost)
+set(BLOBBY_COMMON_LIBS ${LUA_LIBRARIES} blobnet::blobnet ${TINYXML2_LIBRARIES} PhysFS::PhysFS SDL2::SDL2main SDL2::SDL2 Boost::boost)
 
 # other additional dependencies
 if (NOT WIN32)
@@ -131,13 +133,13 @@
 	endif ()
 endif ()
 
-target_include_directories(blobby PRIVATE ${LUA_INCLUDE_DIR})
+target_include_directories(blobby PRIVATE ${LUA_INCLUDE_DIR} ${TINYXML2_INCLUDE_DIRS})
 target_link_libraries(blobby ${BLOBBY_COMMON_LIBS} ${OPENGL_LIBRARIES})
 
 
 if (UNIX AND (NOT ANDROID) OR WIN32)
 	add_executable(blobby-server ${blobby-server_SRC})
-	target_include_directories(blobby-server PRIVATE ${LUA_INCLUDE_DIR})
+	target_include_directories(blobby-server PRIVATE ${LUA_INCLUDE_DIR} ${TINYXML2_INCLUDE_DIRS})
 	target_link_libraries(blobby-server ${BLOBBY_COMMON_LIBS})
 endif ()
 if (UNIX AND (NOT ANDROID))