blob: 259627adb2a50a711f1f2686b7823caee4d931c9 (
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
|
Description: Build supertuxkart against system enet instead of embedded copy
Forwarded: not-yet
Author: Vincent Cheng <vcheng@debian.org>
Last-Update: 2016-07-17
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -63,9 +63,9 @@
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")
+# ENet
+find_package(ENet REQUIRED)
+include_directories(${ENET_INCLUDE_DIR})
# Build glew library
add_definitions(-DGLEW_NO_GLU)
@@ -342,11 +342,11 @@
bulletdynamics
bulletcollision
bulletmath
- enet
glew
stkirrlicht
${Angelscript_LIBRARIES}
${CURL_LIBRARIES}
+ ${ENET_LIBRARIES}
${OGGVORBIS_LIBRARIES}
${OPENAL_LIBRARY}
${OPENGL_LIBRARIES}
--- /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)
|