-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#22428) freeglut: Use the mesa-glu package when not on Apple or Windows
The glu/system package installs the Mesa GLU system package on Linux and FreeBSD. Now that the mesa-glu package is available in Conan, use that instead.
- Loading branch information
1 parent
3d3d57e
commit 86284a9
Showing
5 changed files
with
213 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
...reeglut/all/patches/3.2.1-0004-Incorporate-the-include-directory-for-glu.h-in-CMake.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
From c81e600ace29bf5f3ded5e2650859f3303aaac6e Mon Sep 17 00:00:00 2001 | ||
From: Jordan Williams <jordan@jwillikers.com> | ||
Date: Wed, 7 Feb 2024 10:09:25 -0600 | ||
Subject: [PATCH] Incorporate the include directory for glu.h in CMake | ||
|
||
FreeGLUT doesn't properly check for the glu.h header file when it is required. | ||
The glu.h header is not necessary when FreeGLUT is built for GLES. | ||
However, the demos require use libGLU and so require the include and the library. | ||
|
||
CMake's FindOpenGL didn't properly search for the glu.h header file until very recently. | ||
Refer to this PR: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9216. | ||
|
||
This PR checks for the glu.h header and adds the corresponding include directory when it is required. | ||
For versions of CMake prior to 3.29, the include directory for GLU is added even when linking against the OpenGL::GLU target. | ||
Like the FindOpenGL module, GLU include directories are ignored on Windows. | ||
--- | ||
CMakeLists.txt | 21 ++++++++++++++++++++- | ||
1 file changed, 20 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 772e73f3..162eec40 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -290,6 +290,17 @@ ELSE() | ||
LIST(APPEND LIBS ${OPENGL_gl_LIBRARY}) | ||
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) | ||
endif() | ||
+ | ||
+ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows") | ||
+ # CMake 3.29 properly locates the include directory for glu.h in the OPENGL_GLU_INCLUDE_DIR variable for us. | ||
+ if(CMAKE_VERSION VERSION_LESS "3.29") | ||
+ FIND_PATH(OPENGL_GLU_INCLUDE_DIR NAMES GL/glu.h OpenGL/glu.h HINTS ${OPENGL_INCLUDE_DIR}) | ||
+ endif() | ||
+ if(NOT OPENGL_GLU_INCLUDE_DIR) | ||
+ message(FATAL_ERROR "Failed to find the glu.h header file.") | ||
+ endif() | ||
+ INCLUDE_DIRECTORIES(${OPENGL_GLU_INCLUDE_DIR}) | ||
+ endif() | ||
ENDIF() | ||
|
||
# For Wayland: compile with -DFREEGLUT_WAYLAND and pull EGL | ||
@@ -566,7 +577,15 @@ INSTALL(FILES ${FREEGLUT_HEADERS} DESTINATION include/GL COMPONENT Devel) | ||
# Optionally build demos, on by default. | ||
option( FREEGLUT_BUILD_DEMOS "Build FreeGLUT demos." ON ) | ||
|
||
-SET(DEMO_LIBS ${OPENGL_glu_LIBRARY} ${LIBS}) | ||
+set(DEMO_LIBS ${LIBS}) | ||
+if (FREEGLUT_BUILD_DEMOS) | ||
+ if (OPENGL_GLU_FOUND) | ||
+ list(APPEND DEMO_LIBS ${OPENGL_glu_LIBRARY}) | ||
+ else() | ||
+ message(FATAL_ERROR "Failed to find the GLU library which is required to build the demos.") | ||
+ endif() | ||
+endif() | ||
+ | ||
# lib m for math, not needed on windows | ||
IF (NOT WIN32) | ||
LIST(APPEND DEMO_LIBS m) | ||
-- | ||
2.43.2 | ||
|
61 changes: 61 additions & 0 deletions
61
...reeglut/all/patches/3.2.2-0003-Incorporate-the-include-directory-for-glu.h-in-CMake.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
From 278ac11cf27c8112021735240dc0b34fe849045e Mon Sep 17 00:00:00 2001 | ||
From: Jordan Williams <jordan@jwillikers.com> | ||
Date: Wed, 7 Feb 2024 10:09:25 -0600 | ||
Subject: [PATCH] Incorporate the include directory for glu.h in CMake | ||
|
||
FreeGLUT doesn't properly check for the glu.h header file when it is required. | ||
The glu.h header is not necessary when FreeGLUT is built for GLES. | ||
However, the demos require use libGLU and so require the include and the library. | ||
|
||
CMake's FindOpenGL didn't properly search for the glu.h header file until very recently. | ||
Refer to this PR: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9216. | ||
|
||
This PR checks for the glu.h header and adds the corresponding include directory when it is required. | ||
For versions of CMake prior to 3.29, the include directory for GLU is added even when linking against the OpenGL::GLU target. | ||
Like the FindOpenGL module, GLU include directories are ignored on Windows. | ||
--- | ||
CMakeLists.txt | 21 ++++++++++++++++++++- | ||
1 file changed, 20 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index c2549b1b..4ebc33af 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -294,6 +294,17 @@ ELSE() | ||
LIST(APPEND LIBS ${OPENGL_gl_LIBRARY}) | ||
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) | ||
endif() | ||
+ | ||
+ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows") | ||
+ # CMake 3.29 properly locates the include directory for glu.h in the OPENGL_GLU_INCLUDE_DIR variable for us. | ||
+ if(CMAKE_VERSION VERSION_LESS "3.29") | ||
+ FIND_PATH(OPENGL_GLU_INCLUDE_DIR NAMES GL/glu.h OpenGL/glu.h HINTS ${OPENGL_INCLUDE_DIR}) | ||
+ endif() | ||
+ if(NOT OPENGL_GLU_INCLUDE_DIR) | ||
+ message(FATAL_ERROR "Failed to find the glu.h header file.") | ||
+ endif() | ||
+ INCLUDE_DIRECTORIES(${OPENGL_GLU_INCLUDE_DIR}) | ||
+ endif() | ||
ENDIF() | ||
|
||
# For Wayland: compile with -DFREEGLUT_WAYLAND and pull EGL | ||
@@ -578,7 +589,15 @@ INSTALL(FILES ${FREEGLUT_HEADERS} DESTINATION include/GL COMPONENT Devel) | ||
# Optionally build demos, on by default. | ||
option( FREEGLUT_BUILD_DEMOS "Build FreeGLUT demos." ON ) | ||
|
||
-SET(DEMO_LIBS ${OPENGL_glu_LIBRARY} ${LIBS}) | ||
+set(DEMO_LIBS ${LIBS}) | ||
+if (FREEGLUT_BUILD_DEMOS) | ||
+ if (OPENGL_GLU_FOUND) | ||
+ list(APPEND DEMO_LIBS ${OPENGL_glu_LIBRARY}) | ||
+ else() | ||
+ message(FATAL_ERROR "Failed to find the GLU library which is required to build the demos.") | ||
+ endif() | ||
+endif() | ||
+ | ||
# lib m for math, not needed on windows | ||
IF (NOT WIN32) | ||
LIST(APPEND DEMO_LIBS m) | ||
-- | ||
2.43.2 | ||
|
69 changes: 69 additions & 0 deletions
69
...reeglut/all/patches/3.4.0-0003-Incorporate-the-include-directory-for-glu.h-in-CMake.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
From 90f733b3adec8b3f97a24d4dd9dc47a595a17c2c Mon Sep 17 00:00:00 2001 | ||
From: Jordan Williams <jordan@jwillikers.com> | ||
Date: Wed, 7 Feb 2024 10:09:25 -0600 | ||
Subject: [PATCH] Incorporate the include directory for glu.h in CMake | ||
|
||
FreeGLUT doesn't properly check for the glu.h header file when it is required. | ||
The glu.h header is not necessary when FreeGLUT is built for GLES. | ||
However, the demos require use libGLU and so require the include and the library. | ||
|
||
CMake's FindOpenGL didn't properly search for the glu.h header file until very recently. | ||
Refer to this PR: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9216. | ||
|
||
This PR checks for the glu.h header and adds the corresponding include directory when it is required. | ||
For versions of CMake prior to 3.29, the include directory for GLU is added even when linking against the OpenGL::GLU target. | ||
Like the FindOpenGL module, GLU include directories are ignored on Windows. | ||
--- | ||
CMakeLists.txt | 22 +++++++++++++++++++++- | ||
1 file changed, 21 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index afb4d735..aaf854d8 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -324,6 +324,7 @@ ELSE() | ||
get_filename_component(X11_LIB_PATH ${X11_Xi_LIB} DIRECTORY) | ||
|
||
find_library(OPENGL_gl_LIBRARY NAME GL HINTS ${X11_LIB_PATH}) | ||
+ find_path(OPENGL_GLU_INCLUDE_DIR NAMES GL/glu.h OpenGL/glu.h HINTS ${X11_Xi_INCLUDE_PATH}) | ||
find_library(OPENGL_glu_LIBRARY NAME GLU HINTS ${X11_LIB_PATH}) | ||
endif() | ||
|
||
@@ -335,6 +336,17 @@ ELSE() | ||
LIST(APPEND LIBS ${OPENGL_gl_LIBRARY}) | ||
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) | ||
endif() | ||
+ | ||
+ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows") | ||
+ # CMake 3.29 properly locates the include directory for glu.h in the OPENGL_GLU_INCLUDE_DIR variable for us. | ||
+ if(CMAKE_VERSION VERSION_LESS "3.29") | ||
+ FIND_PATH(OPENGL_GLU_INCLUDE_DIR NAMES GL/glu.h OpenGL/glu.h HINTS ${OPENGL_INCLUDE_DIR}) | ||
+ endif() | ||
+ if(NOT OPENGL_GLU_INCLUDE_DIR) | ||
+ message(FATAL_ERROR "Failed to find the glu.h header file.") | ||
+ endif() | ||
+ INCLUDE_DIRECTORIES(${OPENGL_GLU_INCLUDE_DIR}) | ||
+ endif() | ||
ENDIF() | ||
|
||
# For Wayland: compile with -DFREEGLUT_WAYLAND and pull EGL | ||
@@ -599,7 +611,15 @@ INSTALL(FILES ${FREEGLUT_HEADERS} DESTINATION include/GL COMPONENT Devel) | ||
# Optionally build demos, on by default. | ||
option( FREEGLUT_BUILD_DEMOS "Build FreeGLUT demos." ON ) | ||
|
||
-SET(DEMO_LIBS ${OPENGL_glu_LIBRARY} ${LIBS}) | ||
+set(DEMO_LIBS ${LIBS}) | ||
+if (FREEGLUT_BUILD_DEMOS) | ||
+ if (OPENGL_GLU_FOUND) | ||
+ list(APPEND DEMO_LIBS ${OPENGL_glu_LIBRARY}) | ||
+ else() | ||
+ message(FATAL_ERROR "Failed to find the GLU library which is required to build the demos.") | ||
+ endif() | ||
+endif() | ||
+ | ||
# lib m for math, not needed on windows | ||
IF (NOT WIN32) | ||
LIST(APPEND DEMO_LIBS m) | ||
-- | ||
2.43.2 | ||
|