From 5a1275f661f2d879411411a1376b790f8aec7947 Mon Sep 17 00:00:00 2001 From: sanine Date: Sun, 21 Aug 2022 20:27:25 -0500 Subject: add glfw library --- libs/glfw-3.3.8/CMake/GenerateMappings.cmake | 48 ++++++++++++++++++++++ libs/glfw-3.3.8/CMake/MacOSXBundleInfo.plist.in | 38 +++++++++++++++++ libs/glfw-3.3.8/CMake/i686-w64-mingw32-clang.cmake | 13 ++++++ libs/glfw-3.3.8/CMake/i686-w64-mingw32.cmake | 13 ++++++ libs/glfw-3.3.8/CMake/modules/FindEpollShim.cmake | 17 ++++++++ libs/glfw-3.3.8/CMake/modules/FindOSMesa.cmake | 18 ++++++++ .../CMake/modules/FindWaylandProtocols.cmake | 26 ++++++++++++ libs/glfw-3.3.8/CMake/modules/FindXKBCommon.cmake | 34 +++++++++++++++ .../CMake/x86_64-w64-mingw32-clang.cmake | 13 ++++++ libs/glfw-3.3.8/CMake/x86_64-w64-mingw32.cmake | 13 ++++++ 10 files changed, 233 insertions(+) create mode 100644 libs/glfw-3.3.8/CMake/GenerateMappings.cmake create mode 100644 libs/glfw-3.3.8/CMake/MacOSXBundleInfo.plist.in create mode 100644 libs/glfw-3.3.8/CMake/i686-w64-mingw32-clang.cmake create mode 100644 libs/glfw-3.3.8/CMake/i686-w64-mingw32.cmake create mode 100644 libs/glfw-3.3.8/CMake/modules/FindEpollShim.cmake create mode 100644 libs/glfw-3.3.8/CMake/modules/FindOSMesa.cmake create mode 100644 libs/glfw-3.3.8/CMake/modules/FindWaylandProtocols.cmake create mode 100644 libs/glfw-3.3.8/CMake/modules/FindXKBCommon.cmake create mode 100644 libs/glfw-3.3.8/CMake/x86_64-w64-mingw32-clang.cmake create mode 100644 libs/glfw-3.3.8/CMake/x86_64-w64-mingw32.cmake (limited to 'libs/glfw-3.3.8/CMake') diff --git a/libs/glfw-3.3.8/CMake/GenerateMappings.cmake b/libs/glfw-3.3.8/CMake/GenerateMappings.cmake new file mode 100644 index 0000000..47e6374 --- /dev/null +++ b/libs/glfw-3.3.8/CMake/GenerateMappings.cmake @@ -0,0 +1,48 @@ +# Usage: +# cmake -P GenerateMappings.cmake + +set(source_url "https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt") +set(source_path "${CMAKE_CURRENT_BINARY_DIR}/gamecontrollerdb.txt") +set(template_path "${CMAKE_ARGV3}") +set(target_path "${CMAKE_ARGV4}") + +if (NOT EXISTS "${template_path}") + message(FATAL_ERROR "Failed to find template file ${template_path}") +endif() + +file(DOWNLOAD "${source_url}" "${source_path}" + STATUS download_status + TLS_VERIFY on) + +list(GET download_status 0 status_code) +list(GET download_status 1 status_message) + +if (status_code) + message(FATAL_ERROR "Failed to download ${source_url}: ${status_message}") +endif() + +file(STRINGS "${source_path}" lines) +foreach(line ${lines}) + if (line MATCHES "^[0-9a-fA-F]") + if (line MATCHES "platform:Windows") + if (GLFW_WIN32_MAPPINGS) + set(GLFW_WIN32_MAPPINGS "${GLFW_WIN32_MAPPINGS}\n") + endif() + set(GLFW_WIN32_MAPPINGS "${GLFW_WIN32_MAPPINGS}\"${line}\",") + elseif (line MATCHES "platform:Mac OS X") + if (GLFW_COCOA_MAPPINGS) + set(GLFW_COCOA_MAPPINGS "${GLFW_COCOA_MAPPINGS}\n") + endif() + set(GLFW_COCOA_MAPPINGS "${GLFW_COCOA_MAPPINGS}\"${line}\",") + elseif (line MATCHES "platform:Linux") + if (GLFW_LINUX_MAPPINGS) + set(GLFW_LINUX_MAPPINGS "${GLFW_LINUX_MAPPINGS}\n") + endif() + set(GLFW_LINUX_MAPPINGS "${GLFW_LINUX_MAPPINGS}\"${line}\",") + endif() + endif() +endforeach() + +configure_file("${template_path}" "${target_path}" @ONLY NEWLINE_STYLE UNIX) +file(REMOVE "${source_path}") + diff --git a/libs/glfw-3.3.8/CMake/MacOSXBundleInfo.plist.in b/libs/glfw-3.3.8/CMake/MacOSXBundleInfo.plist.in new file mode 100644 index 0000000..684ad79 --- /dev/null +++ b/libs/glfw-3.3.8/CMake/MacOSXBundleInfo.plist.in @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${MACOSX_BUNDLE_EXECUTABLE_NAME} + CFBundleGetInfoString + ${MACOSX_BUNDLE_INFO_STRING} + CFBundleIconFile + ${MACOSX_BUNDLE_ICON_FILE} + CFBundleIdentifier + ${MACOSX_BUNDLE_GUI_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleLongVersionString + ${MACOSX_BUNDLE_LONG_VERSION_STRING} + CFBundleName + ${MACOSX_BUNDLE_BUNDLE_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + ${MACOSX_BUNDLE_SHORT_VERSION_STRING} + CFBundleSignature + ???? + CFBundleVersion + ${MACOSX_BUNDLE_BUNDLE_VERSION} + CSResourcesFileMapped + + LSRequiresCarbon + + NSHumanReadableCopyright + ${MACOSX_BUNDLE_COPYRIGHT} + NSHighResolutionCapable + + + diff --git a/libs/glfw-3.3.8/CMake/i686-w64-mingw32-clang.cmake b/libs/glfw-3.3.8/CMake/i686-w64-mingw32-clang.cmake new file mode 100644 index 0000000..8726b23 --- /dev/null +++ b/libs/glfw-3.3.8/CMake/i686-w64-mingw32-clang.cmake @@ -0,0 +1,13 @@ +# Define the environment for cross-compiling with 32-bit MinGW-w64 Clang +SET(CMAKE_SYSTEM_NAME Windows) # Target system name +SET(CMAKE_SYSTEM_VERSION 1) +SET(CMAKE_C_COMPILER "i686-w64-mingw32-clang") +SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-clang++") +SET(CMAKE_RC_COMPILER "i686-w64-mingw32-windres") +SET(CMAKE_RANLIB "i686-w64-mingw32-ranlib") + +# Configure the behaviour of the find commands +SET(CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32") +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/libs/glfw-3.3.8/CMake/i686-w64-mingw32.cmake b/libs/glfw-3.3.8/CMake/i686-w64-mingw32.cmake new file mode 100644 index 0000000..2ca4dcd --- /dev/null +++ b/libs/glfw-3.3.8/CMake/i686-w64-mingw32.cmake @@ -0,0 +1,13 @@ +# Define the environment for cross-compiling with 32-bit MinGW-w64 GCC +SET(CMAKE_SYSTEM_NAME Windows) # Target system name +SET(CMAKE_SYSTEM_VERSION 1) +SET(CMAKE_C_COMPILER "i686-w64-mingw32-gcc") +SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-g++") +SET(CMAKE_RC_COMPILER "i686-w64-mingw32-windres") +SET(CMAKE_RANLIB "i686-w64-mingw32-ranlib") + +# Configure the behaviour of the find commands +SET(CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32") +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/libs/glfw-3.3.8/CMake/modules/FindEpollShim.cmake b/libs/glfw-3.3.8/CMake/modules/FindEpollShim.cmake new file mode 100644 index 0000000..f34d070 --- /dev/null +++ b/libs/glfw-3.3.8/CMake/modules/FindEpollShim.cmake @@ -0,0 +1,17 @@ +# Find EpollShim +# Once done, this will define +# +# EPOLLSHIM_FOUND - System has EpollShim +# EPOLLSHIM_INCLUDE_DIRS - The EpollShim include directories +# EPOLLSHIM_LIBRARIES - The libraries needed to use EpollShim + +find_path(EPOLLSHIM_INCLUDE_DIRS NAMES sys/epoll.h sys/timerfd.h HINTS /usr/local/include/libepoll-shim) +find_library(EPOLLSHIM_LIBRARIES NAMES epoll-shim libepoll-shim HINTS /usr/local/lib) + +if (EPOLLSHIM_INCLUDE_DIRS AND EPOLLSHIM_LIBRARIES) + set(EPOLLSHIM_FOUND TRUE) +endif (EPOLLSHIM_INCLUDE_DIRS AND EPOLLSHIM_LIBRARIES) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(EpollShim DEFAULT_MSG EPOLLSHIM_LIBRARIES EPOLLSHIM_INCLUDE_DIRS) +mark_as_advanced(EPOLLSHIM_INCLUDE_DIRS EPOLLSHIM_LIBRARIES) diff --git a/libs/glfw-3.3.8/CMake/modules/FindOSMesa.cmake b/libs/glfw-3.3.8/CMake/modules/FindOSMesa.cmake new file mode 100644 index 0000000..3194bd9 --- /dev/null +++ b/libs/glfw-3.3.8/CMake/modules/FindOSMesa.cmake @@ -0,0 +1,18 @@ +# Try to find OSMesa on a Unix system +# +# This will define: +# +# OSMESA_LIBRARIES - Link these to use OSMesa +# OSMESA_INCLUDE_DIR - Include directory for OSMesa +# +# Copyright (c) 2014 Brandon Schaefer + +if (NOT WIN32) + + find_package (PkgConfig) + pkg_check_modules (PKG_OSMESA QUIET osmesa) + + set (OSMESA_INCLUDE_DIR ${PKG_OSMESA_INCLUDE_DIRS}) + set (OSMESA_LIBRARIES ${PKG_OSMESA_LIBRARIES}) + +endif () diff --git a/libs/glfw-3.3.8/CMake/modules/FindWaylandProtocols.cmake b/libs/glfw-3.3.8/CMake/modules/FindWaylandProtocols.cmake new file mode 100644 index 0000000..8eb83f2 --- /dev/null +++ b/libs/glfw-3.3.8/CMake/modules/FindWaylandProtocols.cmake @@ -0,0 +1,26 @@ +find_package(PkgConfig) + +pkg_check_modules(WaylandProtocols QUIET wayland-protocols>=${WaylandProtocols_FIND_VERSION}) + +execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=pkgdatadir wayland-protocols + OUTPUT_VARIABLE WaylandProtocols_PKGDATADIR + RESULT_VARIABLE _pkgconfig_failed) +if (_pkgconfig_failed) + message(FATAL_ERROR "Missing wayland-protocols pkgdatadir") +endif() + +string(REGEX REPLACE "[\r\n]" "" WaylandProtocols_PKGDATADIR "${WaylandProtocols_PKGDATADIR}") + +find_package_handle_standard_args(WaylandProtocols + FOUND_VAR + WaylandProtocols_FOUND + REQUIRED_VARS + WaylandProtocols_PKGDATADIR + VERSION_VAR + WaylandProtocols_VERSION + HANDLE_COMPONENTS +) + +set(WAYLAND_PROTOCOLS_FOUND ${WaylandProtocols_FOUND}) +set(WAYLAND_PROTOCOLS_PKGDATADIR ${WaylandProtocols_PKGDATADIR}) +set(WAYLAND_PROTOCOLS_VERSION ${WaylandProtocols_VERSION}) diff --git a/libs/glfw-3.3.8/CMake/modules/FindXKBCommon.cmake b/libs/glfw-3.3.8/CMake/modules/FindXKBCommon.cmake new file mode 100644 index 0000000..0f571ee --- /dev/null +++ b/libs/glfw-3.3.8/CMake/modules/FindXKBCommon.cmake @@ -0,0 +1,34 @@ +# - Try to find XKBCommon +# Once done, this will define +# +# XKBCOMMON_FOUND - System has XKBCommon +# XKBCOMMON_INCLUDE_DIRS - The XKBCommon include directories +# XKBCOMMON_LIBRARIES - The libraries needed to use XKBCommon +# XKBCOMMON_DEFINITIONS - Compiler switches required for using XKBCommon + +find_package(PkgConfig) +pkg_check_modules(PC_XKBCOMMON QUIET xkbcommon) +set(XKBCOMMON_DEFINITIONS ${PC_XKBCOMMON_CFLAGS_OTHER}) + +find_path(XKBCOMMON_INCLUDE_DIR + NAMES xkbcommon/xkbcommon.h + HINTS ${PC_XKBCOMMON_INCLUDE_DIR} ${PC_XKBCOMMON_INCLUDE_DIRS} +) + +find_library(XKBCOMMON_LIBRARY + NAMES xkbcommon + HINTS ${PC_XKBCOMMON_LIBRARY} ${PC_XKBCOMMON_LIBRARY_DIRS} +) + +set(XKBCOMMON_LIBRARIES ${XKBCOMMON_LIBRARY}) +set(XKBCOMMON_LIBRARY_DIRS ${XKBCOMMON_LIBRARY_DIRS}) +set(XKBCOMMON_INCLUDE_DIRS ${XKBCOMMON_INCLUDE_DIR}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(XKBCommon DEFAULT_MSG + XKBCOMMON_LIBRARY + XKBCOMMON_INCLUDE_DIR +) + +mark_as_advanced(XKBCOMMON_LIBRARY XKBCOMMON_INCLUDE_DIR) + diff --git a/libs/glfw-3.3.8/CMake/x86_64-w64-mingw32-clang.cmake b/libs/glfw-3.3.8/CMake/x86_64-w64-mingw32-clang.cmake new file mode 100644 index 0000000..60f7914 --- /dev/null +++ b/libs/glfw-3.3.8/CMake/x86_64-w64-mingw32-clang.cmake @@ -0,0 +1,13 @@ +# Define the environment for cross-compiling with 64-bit MinGW-w64 Clang +SET(CMAKE_SYSTEM_NAME Windows) # Target system name +SET(CMAKE_SYSTEM_VERSION 1) +SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-clang") +SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-clang++") +SET(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres") +SET(CMAKE_RANLIB "x86_64-w64-mingw32-ranlib") + +# Configure the behaviour of the find commands +SET(CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32") +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/libs/glfw-3.3.8/CMake/x86_64-w64-mingw32.cmake b/libs/glfw-3.3.8/CMake/x86_64-w64-mingw32.cmake new file mode 100644 index 0000000..063e845 --- /dev/null +++ b/libs/glfw-3.3.8/CMake/x86_64-w64-mingw32.cmake @@ -0,0 +1,13 @@ +# Define the environment for cross-compiling with 64-bit MinGW-w64 GCC +SET(CMAKE_SYSTEM_NAME Windows) # Target system name +SET(CMAKE_SYSTEM_VERSION 1) +SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-gcc") +SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-g++") +SET(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres") +SET(CMAKE_RANLIB "x86_64-w64-mingw32-ranlib") + +# Configure the behaviour of the find commands +SET(CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32") +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -- cgit v1.2.1