Blob Blame Raw
From 85696d8a3242c1af9d12744c650adfe6b16dada3 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Date: Mon, 20 Nov 2017 13:54:22 +0100
Subject: [PATCH 1/4] Unbundle ENet

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
---
 CMakeLists.txt | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5b6f4ade0..e29cb1336 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -106,8 +106,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")
+find_package (PkgConfig REQUIRED)
+pkg_check_modules (ENet libenet REQUIRED)
+include_directories(${ENet_INCLUDE_DIRS})
 
 # Build glew library
 if(NOT USE_GLES2 AND NOT SERVER_ONLY)
@@ -406,7 +407,7 @@ target_link_libraries(supertuxkart
     bulletdynamics
     bulletcollision
     bulletmath
-    enet
+    ${ENet_LIBRARIES}
     stkirrlicht
     ${Angelscript_LIBRARIES}
     ${CURL_LIBRARIES}