Blob Blame Raw
From 4997a72c7140642f7252ad6b84beebac24cd82cc Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Date: Mon, 20 Nov 2017 14:01:24 +0100
Subject: [PATCH 3/4] Unbundle GLEW

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 fc1dcf787..5a2bedc6b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -113,8 +113,9 @@ include_directories(${ENet_INCLUDE_DIRS})
 # Build glew library
 if(NOT USE_GLES2 AND NOT SERVER_ONLY)
     add_definitions(-DGLEW_NO_GLU)
-    add_subdirectory("${PROJECT_SOURCE_DIR}/lib/glew")
-    include_directories("${PROJECT_SOURCE_DIR}/lib/glew/include")
+    find_package(PkgConfig REQUIRED)
+    pkg_check_modules(GLEW glew)
+    include_directories(${GLEW_INCLUDE_DIRS})
 endif()
 
 if(MSVC OR APPLE)
@@ -419,7 +420,7 @@ target_link_libraries(supertuxkart
 
 if(NOT SERVER_ONLY)
     if(NOT USE_GLES2)
-        target_link_libraries(supertuxkart ${OPENGL_gl_LIBRARY} glew graphics_utils)
+        target_link_libraries(supertuxkart ${OPENGL_gl_LIBRARY} ${GLEW_LIBRARIES} graphics_utils)
     else()
         target_link_libraries(supertuxkart GLESv2)
     endif()