diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/freeglut/vcpkg-cmake-wrapper.cmake | |
Diffstat (limited to 'vcpkg/ports/freeglut/vcpkg-cmake-wrapper.cmake')
| -rw-r--r-- | vcpkg/ports/freeglut/vcpkg-cmake-wrapper.cmake | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/vcpkg/ports/freeglut/vcpkg-cmake-wrapper.cmake b/vcpkg/ports/freeglut/vcpkg-cmake-wrapper.cmake new file mode 100644 index 0000000..f7f792c --- /dev/null +++ b/vcpkg/ports/freeglut/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,37 @@ +_find_package(${ARGS})
+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_FOUND AND NOT "X11" IN_LIST GLUT_LIBRARIES)
+ list(APPEND GLUT_LIBRARIES "${X11_X11_LIB}")
+ set_property(TARGET GLUT::GLUT APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${X11_X11_LIB}")
+ endif()
+ 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_Xxf86vm_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()
|