-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[freeglut] Update to 3.2.2, fix X11 dependencies (#23807)
* Update to 3.2.2 * Extend X11 dependencies patch * Update the FindGLUT wrapper * Update versions * Modernize portfile * Set policies * Update versions * Switch to github * Update versions * CI * Replace GLUT_LIBRARIES with GLUT_LINK_LIBRARIES * Update versions
- Loading branch information
Showing
9 changed files
with
159 additions
and
112 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,10 +1,33 @@ | ||
_find_package(${ARGS}) | ||
if(GLUT_FOUND) | ||
find_library(XRANDR_LIBRARY NAMES xrandr Xrandr) | ||
if(XRANDR_LIBRARY) | ||
list(APPEND GLUT_LIBRARIES ${XRANDR_LIBRARY}) | ||
if(TARGET GLUT::GLUT) | ||
set_property(TARGET GLUT::GLUT APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${XRANDR_LIBRARY}) | ||
if(GLUT_FOUND AND UNIX AND NOT ANDROID) | ||
cmake_policy(PUSH) | ||
cmake_policy(SET CMP0012 NEW) | ||
cmake_policy(SET CMP0054 NEW) | ||
cmake_policy(SET CMP0057 NEW) | ||
|
||
if(GLUT_LINK_LIBRARIES) | ||
# Since CMake 3.22, FindGLUT.cmake loads the glut pkg-config module. | ||
# We need `-lglut` resolved to an absolute path. | ||
set(GLUT_LIBRARIES "${GLUT_LINK_LIBRARIES}") | ||
else() | ||
find_package(X11) | ||
# Before CMake 3.14, FindX11.cmake doesn't create imported targets. | ||
# For X11, we simply assume shared linkage of system libs, | ||
# so order and transitive usage requirements don't matter. | ||
if(X11_Xrandr_FOUND AND NOT "Xrandr" IN_LIST GLUT_LIBRARIES) | ||
list(APPEND GLUT_LIBRARIES "${X11_Xrandr_LIB}") | ||
set_property(TARGET GLUT::GLUT APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${X11_Xrandr_LIB}") | ||
endif() | ||
# X11_xf86vmode_FOUND for CMake < 3.14 | ||
if((X11_xf86vm_FOUND OR X11_xf86vmode_FOUND) AND NOT "Xxf86vm" IN_LIST GLUT_LIBRARIES) | ||
list(APPEND GLUT_LIBRARIES "${X11_Xxf86vm_LIB}") | ||
set_property(TARGET GLUT::GLUT APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${X11_Xxf86vm_LIB}") | ||
endif() | ||
if(X11_Xi_FOUND AND NOT GLUT_Xi_LIBRARY AND NOT "Xi" IN_LIST GLUT_LIBRARIES) | ||
list(APPEND GLUT_LIBRARIES "${X11_Xi_LIB}") | ||
set_property(TARGET GLUT::GLUT APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${X11_Xi_LIB}") | ||
endif() | ||
endif() | ||
|
||
cmake_policy(POP) | ||
endif() |
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 |
---|---|---|
@@ -1,7 +1,17 @@ | ||
{ | ||
"name": "freeglut", | ||
"version-string": "3.2.1", | ||
"port-version": 7, | ||
"version": "3.2.2", | ||
"description": "Open source implementation of GLUT with source and binary backwards compatibility.", | ||
"homepage": "https://sourceforge.net/projects/freeglut/" | ||
"homepage": "https://sourceforge.net/projects/freeglut/", | ||
"license": null, | ||
"dependencies": [ | ||
{ | ||
"name": "vcpkg-cmake", | ||
"host": true | ||
}, | ||
{ | ||
"name": "vcpkg-cmake-config", | ||
"host": true | ||
} | ||
] | ||
} |
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,29 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index aec0a27..73ccbdb 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -429,7 +429,7 @@ IF(WIN32) | ||
ENDIF() | ||
IF(FREEGLUT_BUILD_STATIC_LIBS) | ||
TARGET_COMPILE_DEFINITIONS(freeglut_static PUBLIC FREEGLUT_STATIC) | ||
- IF(FREEGLUT_REPLACE_GLUT) | ||
+ IF(1) | ||
SET_TARGET_PROPERTIES(freeglut_static PROPERTIES OUTPUT_NAME ${LIBNAME}) | ||
ENDIF() | ||
ENDIF() | ||
diff --git a/include/GL/freeglut_std.h b/include/GL/freeglut_std.h | ||
index a5efb3b..6bdcdfb 100644 | ||
--- a/include/GL/freeglut_std.h | ||
+++ b/include/GL/freeglut_std.h | ||
@@ -71,9 +71,9 @@ | ||
/* Link with Win32 static freeglut lib */ | ||
# if FREEGLUT_LIB_PRAGMAS | ||
# if defined(NDEBUG) || !defined(_DEBUG) | ||
-# pragma comment (lib, "freeglut_static.lib") | ||
+# pragma comment (lib, "freeglut.lib") | ||
# else | ||
-# pragma comment (lib, "freeglut_staticd.lib") | ||
+# pragma comment (lib, "freeglutd.lib") | ||
# endif | ||
# endif | ||
|
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,63 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 6f403af..4ced28a 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -72,7 +72,7 @@ SET(FREEGLUT_HEADERS | ||
include/GL/freeglut_ext.h | ||
include/GL/freeglut_std.h | ||
) | ||
-IF(FREEGLUT_REPLACE_GLUT) | ||
+IF(TRUE) | ||
LIST(APPEND FREEGLUT_HEADERS | ||
include/GL/glut.h | ||
) | ||
@@ -319,23 +319,27 @@ IF(CMAKE_COMPILER_IS_GNUCC) | ||
ENDIF() | ||
ENDIF(CMAKE_COMPILER_IS_GNUCC) | ||
|
||
+SET(xlibs_private "") | ||
INCLUDE(CheckIncludeFiles) | ||
IF(UNIX AND NOT(ANDROID OR BLACKBERRY OR FREEGLUT_WAYLAND)) | ||
FIND_PACKAGE(X11 REQUIRED) | ||
- INCLUDE_DIRECTORIES(${X11_X11_INCLUDE_PATH}) | ||
- LIST(APPEND LIBS ${X11_X11_LIB}) | ||
+ LIST(APPEND LIBS X11::X11) | ||
+ set(xlibs_private "-lX11") | ||
IF(X11_Xrandr_FOUND) | ||
SET(HAVE_X11_EXTENSIONS_XRANDR_H TRUE) | ||
- LIST(APPEND LIBS ${X11_Xrandr_LIB}) | ||
+ LIST(APPEND LIBS X11::Xrandr) | ||
+ STRING(APPEND xlibs_private " -lXrandr") | ||
ENDIF() | ||
- IF(X11_xf86vmode_FOUND) | ||
+ IF(X11_Xxf86vm_FOUND) | ||
SET(HAVE_X11_EXTENSIONS_XF86VMODE_H TRUE) | ||
- LIST(APPEND LIBS ${X11_Xxf86vm_LIB}) | ||
+ LIST(APPEND LIBS X11::Xxf86vm) | ||
+ STRING(APPEND xlibs_private " -lXxf86vm") | ||
ENDIF() | ||
IF(X11_Xinput_FOUND) | ||
# Needed for multi-touch: | ||
CHECK_INCLUDE_FILES("${X11_Xinput_INCLUDE_PATH}/X11/extensions/XInput2.h" HAVE_X11_EXTENSIONS_XINPUT2_H) | ||
- LIST(APPEND LIBS ${X11_Xinput_LIB}) | ||
+ LIST(APPEND LIBS X11::Xi) | ||
+ STRING(APPEND xlibs_private " -lXi") | ||
ELSE() | ||
MESSAGE(FATAL_ERROR "Missing X11's XInput.h (X11/extensions/XInput.h)") | ||
ENDIF() | ||
@@ -586,13 +590,13 @@ ELSEIF(FREEGLUT_GLES) | ||
ELSEIF(FREEGLUT_WAYLAND) | ||
SET(PC_LIBS_PRIVATE "-lwayland-client -lwayland-cursor -lwayland-egl -lGLESv2 -lGLESv1_CM -lEGL -lxkbcommon -lm") | ||
ELSE() | ||
- SET(PC_LIBS_PRIVATE "-lX11 -lXxf86vm -lXrandr -lGLESv2 -lGLESv1_CM -lEGL -lm") | ||
+ SET(PC_LIBS_PRIVATE "${xlibs_private} -lGLESv2 -lGLESv1_CM -lEGL -lm") | ||
ENDIF() | ||
ELSE() | ||
IF(FREEGLUT_WAYLAND) | ||
SET(PC_LIBS_PRIVATE "-lwayland-client -lwayland-cursor -lwayland-egl -lGL -lxkbcommon -lm") | ||
ELSE() | ||
- SET(PC_LIBS_PRIVATE "-lX11 -lXxf86vm -lXrandr -lGL -lm") | ||
+ SET(PC_LIBS_PRIVATE "${xlibs_private} -lGL -lm") | ||
ENDIF() | ||
ENDIF() | ||
# Client applications need to define FreeGLUT GLES version to |
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