File: use-system-glew

package info (click to toggle)
limesuite 23.11.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 17,228 kB
  • sloc: cpp: 157,511; ansic: 6,852; python: 197; sh: 56; xml: 21; makefile: 19
file content (63 lines) | stat: -rw-r--r-- 1,607 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
Description: Change build to use system libglew instead of local copy
Author: Andreas Bombe <aeb@debian.org>
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/oglGraph/CMakeLists.txt
+++ b/src/oglGraph/CMakeLists.txt
@@ -2,17 +2,16 @@ set(oglGraph_src_files
 	dlgMarkers.cpp
 	GLFont.cpp
 	OpenGLGraph.cpp
-	glew/glew.c
 )
-include_directories(glew)
-include_directories(glew/GL)
+find_package(PkgConfig REQUIRED)
+pkg_check_modules(GLEW REQUIRED glew)
+include_directories(${GLEW_INCLUDE_DIRS})
 
 #ignore warnings about narrowing: static font header
 if(CMAKE_COMPILER_IS_GNUCXX)
 	add_definitions(-Wno-narrowing)
 endif()
 
-ADD_DEFINITIONS(-DGLEW_STATIC)
 add_library(oglGraph STATIC ${oglGraph_src_files})
 
 set(OpenGL_GL_PREFERENCE GLVND)
@@ -31,12 +30,6 @@ target_include_directories(oglGraph PUBL
     ${OPENGL_INCLUDE_DIR}
 )
 
-if (APPLE)
-	set(GL_LIBS "-framework OpenGL" "-framework GLUT")
-elseif (UNIX)
-	set(GL_LIBS GL ${OPENGL_LIBRARIES})
-endif()
-
 if(UNIX)
-	target_link_libraries(oglGraph ${GL_LIBS} ${wxWidgets_LIBRARIES})
+	target_link_libraries(oglGraph ${GLEW_LIBRARIES} ${wxWidgets_LIBRARIES})
 endif()
--- a/src/oglGraph/OpenGLGraph.h
+++ b/src/oglGraph/OpenGLGraph.h
@@ -7,7 +7,7 @@
 #ifndef OPENGL_GRAPH
 #define OPENGL_GRAPH
 
-#include "glew/GL/glew.h"
+#include <GL/glew.h>
 #if defined(__APPLE__)
 #include <OpenGL/gl.h>
 #else
--- a/src/oglGraph/GLFont.h
+++ b/src/oglGraph/GLFont.h
@@ -1,7 +1,7 @@
 #ifndef GL_FONT_H
 #define GL_FONT_H
 
-#include "glew/GL/glew.h"
+#include <GL/glew.h>
 #if defined(__APPLE__)
 #include <OpenGL/gl.h>
 #else