2024-09-06 06:59:19 +08:00
|
|
|
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()
|
|
|
|
|
2018-11-07 09:50:54 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO glfw/glfw
|
2023-12-14 15:16:15 +08:00
|
|
|
REF ${VERSION}
|
2024-02-27 16:34:58 +08:00
|
|
|
SHA512 39ad7a4521267fbebc35d2ff0c389a56236ead5fa4bdff33db113bd302f70f5f2869ff4e6db1979512e1542813292dff5a482e94dfce231750f0746c301ae9ed
|
2018-11-07 09:50:54 +08:00
|
|
|
HEAD_REF master
|
2016-09-19 11:50:08 +08:00
|
|
|
)
|
|
|
|
|
2020-01-15 02:12:05 +08:00
|
|
|
if(VCPKG_TARGET_IS_LINUX)
|
2018-11-07 09:50:54 +08:00
|
|
|
message(
|
|
|
|
"GLFW3 currently requires the following libraries from the system package manager:
|
|
|
|
xinerama
|
|
|
|
xcursor
|
2019-08-26 11:31:55 +08:00
|
|
|
xorg
|
|
|
|
libglu1-mesa
|
2022-10-21 03:49:29 +08:00
|
|
|
pkg-config
|
2016-09-19 11:50:08 +08:00
|
|
|
|
2023-01-12 15:29:41 +08:00
|
|
|
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")
|
2018-11-07 09:50:54 +08:00
|
|
|
endif()
|
2017-03-31 12:52:18 +08:00
|
|
|
|
2023-01-12 15:29:41 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
2024-02-27 16:34:58 +08:00
|
|
|
wayland GLFW_BUILD_WAYLAND
|
2023-01-12 15:29:41 +08:00
|
|
|
)
|
|
|
|
|
2021-11-16 06:33:27 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2016-09-19 11:50:08 +08:00
|
|
|
OPTIONS
|
|
|
|
-DGLFW_BUILD_EXAMPLES=OFF
|
|
|
|
-DGLFW_BUILD_TESTS=OFF
|
|
|
|
-DGLFW_BUILD_DOCS=OFF
|
2023-01-12 15:29:41 +08:00
|
|
|
${FEATURE_OPTIONS}
|
2024-09-06 06:59:19 +08:00
|
|
|
MAYBE_UNUSED_VARIABLES
|
|
|
|
GLFW_USE_WAYLAND
|
2016-09-19 11:50:08 +08:00
|
|
|
)
|
|
|
|
|
2021-11-16 06:33:27 +08:00
|
|
|
vcpkg_cmake_install()
|
2016-09-19 11:50:08 +08:00
|
|
|
|
2021-11-16 06:33:27 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/glfw3)
|
2016-09-19 11:50:08 +08:00
|
|
|
|
2021-02-11 15:55:18 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
|
|
|
|
2021-11-16 06:33:27 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
2016-09-19 11:50:08 +08:00
|
|
|
|
2024-09-06 06:59:19 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.md")
|