vcpkg/ports/freeglut/macOS_Xquartz.patch
Igor Kostenko 96edc8c4a3
[freeglut] updated to 3.2.1 (#11423)
* [freeglut] updated to 3.2.1

* [freeglut] address review comments

* [freeglut] add glut forwarding header

* [freeglut] revert incorrect wrapper location

* [freeglut] enable FREEGLUT_REPLACE_GLUT

* [freeglut] static lib renaming is not needed anymore

* [freeglut] revert FREEGLUT_REPLACE_GLUT setting, always use glut.h

* Revert "[freeglut] static lib renaming is not needed anymore"

This reverts commit 550018c1b8.
2020-05-21 11:29:52 -07:00

22 lines
841 B
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6f403af..ce6f9f2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -258,6 +258,16 @@ ENDIF()
IF(FREEGLUT_GLES)
LIST(APPEND PUBLIC_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})