vcpkg/ports/freeglut/macOS_Xquartz.patch
2019-05-08 13:47:32 -07:00

22 lines
822 B
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f68b27f..4339858 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -220,6 +220,16 @@ ENDIF()
IF(FREEGLUT_GLES)
ADD_DEFINITIONS(-DFREEGLUT_GLES)
LIST(APPEND LIBS GLESv2 GLESv1_CM EGL)
+ELSEIF(APPLE)
+ # on OSX FindOpenGL uses framework version of OpenGL, but we need X11 version
+ FIND_PATH(GLX_INCLUDE_DIR GL/glx.h
+ PATHS /opt/X11/include /usr/X11/include /usr/X11R6/include)
+ FIND_LIBRARY(OPENGL_gl_LIBRARY GL
+ PATHS /opt/X11/lib /usr/X11/lib /usr/X11R6/lib)
+ FIND_LIBRARY(OPENGL_glu_LIBRARY GLU
+ PATHS /opt/X11/lib /usr/X11/lib /usr/X11R6/lib)
+ LIST(APPEND LIBS ${OPENGL_gl_LIBRARY})
+ INCLUDE_DIRECTORIES(${GLX_INCLUDE_DIR})
ELSE()
FIND_PACKAGE(OpenGL REQUIRED)
LIST(APPEND LIBS ${OPENGL_gl_LIBRARY})