aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/glfw3
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/glfw3
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/glfw3')
-rw-r--r--vcpkg/ports/glfw3/glfw3Config.cmake6
-rw-r--r--vcpkg/ports/glfw3/portfile.cmake57
-rw-r--r--vcpkg/ports/glfw3/vcpkg.json27
3 files changed, 90 insertions, 0 deletions
diff --git a/vcpkg/ports/glfw3/glfw3Config.cmake b/vcpkg/ports/glfw3/glfw3Config.cmake
new file mode 100644
index 0000000..71153f6
--- /dev/null
+++ b/vcpkg/ports/glfw3/glfw3Config.cmake
@@ -0,0 +1,6 @@
+if (NOT TARGET glfw)
+ add_library(glfw INTERFACE IMPORTED)
+ set_target_properties(glfw PROPERTIES
+ INTERFACE_LINK_OPTIONS "-sUSE_GLFW=3"
+ )
+endif()
diff --git a/vcpkg/ports/glfw3/portfile.cmake b/vcpkg/ports/glfw3/portfile.cmake
new file mode 100644
index 0000000..fb5bfa1
--- /dev/null
+++ b/vcpkg/ports/glfw3/portfile.cmake
@@ -0,0 +1,57 @@
+if (VCPKG_TARGET_IS_EMSCRIPTEN)
+ # emscripten has built-in glfw3 library
+ set(VCPKG_BUILD_TYPE release)
+ file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/glfw3Config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/glfw3")
+ set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
+ return()
+endif()
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO glfw/glfw
+ REF ${VERSION}
+ SHA512 39ad7a4521267fbebc35d2ff0c389a56236ead5fa4bdff33db113bd302f70f5f2869ff4e6db1979512e1542813292dff5a482e94dfce231750f0746c301ae9ed
+ HEAD_REF master
+)
+
+if(VCPKG_TARGET_IS_LINUX)
+ message(
+"GLFW3 currently requires the following libraries from the system package manager:
+ xinerama
+ xcursor
+ xorg
+ libglu1-mesa
+ pkg-config
+
+These can be installed on Ubuntu systems via sudo apt install libxinerama-dev libxcursor-dev xorg-dev libglu1-mesa-dev pkg-config
+
+Alternatively, when targeting the Wayland display server, use the packages listed in the GLFW documentation here:
+
+https://www.glfw.org/docs/3.3/compile.html#compile_deps_wayland")
+endif()
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ wayland GLFW_BUILD_WAYLAND
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DGLFW_BUILD_EXAMPLES=OFF
+ -DGLFW_BUILD_TESTS=OFF
+ -DGLFW_BUILD_DOCS=OFF
+ ${FEATURE_OPTIONS}
+ MAYBE_UNUSED_VARIABLES
+ GLFW_USE_WAYLAND
+)
+
+vcpkg_cmake_install()
+
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/glfw3)
+
+vcpkg_fixup_pkgconfig()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.md")
diff --git a/vcpkg/ports/glfw3/vcpkg.json b/vcpkg/ports/glfw3/vcpkg.json
new file mode 100644
index 0000000..14c4fcd
--- /dev/null
+++ b/vcpkg/ports/glfw3/vcpkg.json
@@ -0,0 +1,27 @@
+{
+ "name": "glfw3",
+ "version": "3.4",
+ "port-version": 1,
+ "description": "GLFW is a free, Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan application development. It provides a simple, platform-independent API for creating windows, contexts and surfaces, reading input, handling events, etc.",
+ "homepage": "https://github.com/glfw/glfw",
+ "license": "Zlib",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "features": {
+ "wayland": {
+ "description": "Use Wayland display server",
+ "supports": "linux",
+ "dependencies": [
+ "wayland"
+ ]
+ }
+ }
+}