Package: supertuxkart / 0.8.1-2

build_against_system_enet.patch Patch series | download
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
Description: Build supertuxkart against system enet instead of embedded copy
Forwarded: not-yet
Author: Vincent Cheng <Vincentc1208@gmail.com>
Last-Update: 2012-12-28

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,10 +40,6 @@
 add_subdirectory("${PROJECT_SOURCE_DIR}/lib/bullet")
 include_directories("${PROJECT_SOURCE_DIR}/lib/bullet/src")
 
-# Build the ENet UDP network library
-add_subdirectory("${PROJECT_SOURCE_DIR}/lib/enet")
-include_directories("${PROJECT_SOURCE_DIR}/lib/enet/include")
-
 # Build the irrlicht library
 add_subdirectory("${PROJECT_SOURCE_DIR}/lib/irrlicht")
 include_directories("${PROJECT_SOURCE_DIR}/lib/irrlicht/include")
@@ -107,6 +103,10 @@
 find_package(CURL REQUIRED)
 include_directories(${CURL_INCLUDE_DIRS})
 
+# ENet
+find_package(ENet REQUIRED)
+include_directories(${ENET_INCLUDE_DIR})
+
 # Fribidi
 if(USE_FRIBIDI)
     find_package(Fribidi)
@@ -225,9 +225,9 @@
     bulletdynamics
     bulletcollision
     bulletmath
-    enet
     stkirrlicht
     ${CURL_LIBRARIES}
+    ${ENET_LIBRARIES}
     ${OGGVORBIS_LIBRARIES}
     ${IRRLICHT_XF86VM_LIBRARY}
     ${OPENAL_LIBRARY}
--- /dev/null
+++ b/cmake/FindENet.cmake
@@ -0,0 +1,22 @@
+# - Find ENet
+# Find the ENet includes and libraries
+#
+# Following variables are provided:
+# ENET_FOUND
+#     True if ENet has been found
+# ENET_INCLUDE_DIR
+#     The include directories of ENet
+# ENET_LIBRARIES
+#     ENet library list
+
+
+find_path(ENET_INCLUDE_DIR enet/enet.h /usr/include)
+find_library(ENET_LIBRARY NAMES enet PATHS /usr/lib)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(ENet DEFAULT_MSG ENET_INCLUDE_DIR ENET_LIBRARY)
+
+# Publish variables
+set(ENET_INCLUDE_DIRS ${ENET_INCLUDE_DIR})
+set(ENET_LIBRARIES ${ENET_LIBRARY})
+mark_as_advanced(ENET_INCLUDE_DIR ENET_LIBRARY)