diff options
Diffstat (limited to '')
12 files changed, 383 insertions, 0 deletions
diff --git a/raylib/src/external/glfw/CMake/GenerateMappings.cmake b/raylib/src/external/glfw/CMake/GenerateMappings.cmake new file mode 100644 index 0000000..c8c9e23 --- /dev/null +++ b/raylib/src/external/glfw/CMake/GenerateMappings.cmake | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | # Usage: | ||
| 2 | # cmake -P GenerateMappings.cmake <path/to/mappings.h.in> <path/to/mappings.h> | ||
| 3 | |||
| 4 | set(source_url "https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt") | ||
| 5 | set(source_path "${CMAKE_CURRENT_BINARY_DIR}/gamecontrollerdb.txt") | ||
| 6 | set(template_path "${CMAKE_ARGV3}") | ||
| 7 | set(target_path "${CMAKE_ARGV4}") | ||
| 8 | |||
| 9 | if (NOT EXISTS "${template_path}") | ||
| 10 | message(FATAL_ERROR "Failed to find template file ${template_path}") | ||
| 11 | endif() | ||
| 12 | |||
| 13 | file(DOWNLOAD "${source_url}" "${source_path}" | ||
| 14 | STATUS download_status | ||
| 15 | TLS_VERIFY on) | ||
| 16 | |||
| 17 | list(GET download_status 0 status_code) | ||
| 18 | list(GET download_status 1 status_message) | ||
| 19 | |||
| 20 | if (status_code) | ||
| 21 | message(FATAL_ERROR "Failed to download ${source_url}: ${status_message}") | ||
| 22 | endif() | ||
| 23 | |||
| 24 | file(STRINGS "${source_path}" lines) | ||
| 25 | foreach(line ${lines}) | ||
| 26 | if (line MATCHES "^[0-9a-fA-F]") | ||
| 27 | if (line MATCHES "platform:Windows") | ||
| 28 | if (GLFW_WIN32_MAPPINGS) | ||
| 29 | string(APPEND GLFW_WIN32_MAPPINGS "\n") | ||
| 30 | endif() | ||
| 31 | string(APPEND GLFW_WIN32_MAPPINGS "\"${line}\",") | ||
| 32 | elseif (line MATCHES "platform:Mac OS X") | ||
| 33 | if (GLFW_COCOA_MAPPINGS) | ||
| 34 | string(APPEND GLFW_COCOA_MAPPINGS "\n") | ||
| 35 | endif() | ||
| 36 | string(APPEND GLFW_COCOA_MAPPINGS "\"${line}\",") | ||
| 37 | elseif (line MATCHES "platform:Linux") | ||
| 38 | if (GLFW_LINUX_MAPPINGS) | ||
| 39 | string(APPEND GLFW_LINUX_MAPPINGS "\n") | ||
| 40 | endif() | ||
| 41 | string(APPEND GLFW_LINUX_MAPPINGS "\"${line}\",") | ||
| 42 | endif() | ||
| 43 | endif() | ||
| 44 | endforeach() | ||
| 45 | |||
| 46 | configure_file("${template_path}" "${target_path}" @ONLY NEWLINE_STYLE UNIX) | ||
| 47 | file(REMOVE "${source_path}") | ||
| 48 | |||
diff --git a/raylib/src/external/glfw/CMake/Info.plist.in b/raylib/src/external/glfw/CMake/Info.plist.in new file mode 100644 index 0000000..684ad79 --- /dev/null +++ b/raylib/src/external/glfw/CMake/Info.plist.in | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| 3 | <plist version="1.0"> | ||
| 4 | <dict> | ||
| 5 | <key>CFBundleDevelopmentRegion</key> | ||
| 6 | <string>English</string> | ||
| 7 | <key>CFBundleExecutable</key> | ||
| 8 | <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string> | ||
| 9 | <key>CFBundleGetInfoString</key> | ||
| 10 | <string>${MACOSX_BUNDLE_INFO_STRING}</string> | ||
| 11 | <key>CFBundleIconFile</key> | ||
| 12 | <string>${MACOSX_BUNDLE_ICON_FILE}</string> | ||
| 13 | <key>CFBundleIdentifier</key> | ||
| 14 | <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string> | ||
| 15 | <key>CFBundleInfoDictionaryVersion</key> | ||
| 16 | <string>6.0</string> | ||
| 17 | <key>CFBundleLongVersionString</key> | ||
| 18 | <string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string> | ||
| 19 | <key>CFBundleName</key> | ||
| 20 | <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string> | ||
| 21 | <key>CFBundlePackageType</key> | ||
| 22 | <string>APPL</string> | ||
| 23 | <key>CFBundleShortVersionString</key> | ||
| 24 | <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string> | ||
| 25 | <key>CFBundleSignature</key> | ||
| 26 | <string>????</string> | ||
| 27 | <key>CFBundleVersion</key> | ||
| 28 | <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string> | ||
| 29 | <key>CSResourcesFileMapped</key> | ||
| 30 | <true/> | ||
| 31 | <key>LSRequiresCarbon</key> | ||
| 32 | <true/> | ||
| 33 | <key>NSHumanReadableCopyright</key> | ||
| 34 | <string>${MACOSX_BUNDLE_COPYRIGHT}</string> | ||
| 35 | <key>NSHighResolutionCapable</key> | ||
| 36 | <true/> | ||
| 37 | </dict> | ||
| 38 | </plist> | ||
diff --git a/raylib/src/external/glfw/CMake/cmake_uninstall.cmake.in b/raylib/src/external/glfw/CMake/cmake_uninstall.cmake.in new file mode 100644 index 0000000..5ecc476 --- /dev/null +++ b/raylib/src/external/glfw/CMake/cmake_uninstall.cmake.in | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | |||
| 2 | if (NOT EXISTS "@GLFW_BINARY_DIR@/install_manifest.txt") | ||
| 3 | message(FATAL_ERROR "Cannot find install manifest: \"@GLFW_BINARY_DIR@/install_manifest.txt\"") | ||
| 4 | endif() | ||
| 5 | |||
| 6 | file(READ "@GLFW_BINARY_DIR@/install_manifest.txt" files) | ||
| 7 | string(REGEX REPLACE "\n" ";" files "${files}") | ||
| 8 | |||
| 9 | foreach (file ${files}) | ||
| 10 | message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") | ||
| 11 | if (EXISTS "$ENV{DESTDIR}${file}") | ||
| 12 | exec_program("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" | ||
| 13 | OUTPUT_VARIABLE rm_out | ||
| 14 | RETURN_VALUE rm_retval) | ||
| 15 | if (NOT "${rm_retval}" STREQUAL 0) | ||
| 16 | MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") | ||
| 17 | endif() | ||
| 18 | elseif (IS_SYMLINK "$ENV{DESTDIR}${file}") | ||
| 19 | EXEC_PROGRAM("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" | ||
| 20 | OUTPUT_VARIABLE rm_out | ||
| 21 | RETURN_VALUE rm_retval) | ||
| 22 | if (NOT "${rm_retval}" STREQUAL 0) | ||
| 23 | message(FATAL_ERROR "Problem when removing symlink \"$ENV{DESTDIR}${file}\"") | ||
| 24 | endif() | ||
| 25 | else() | ||
| 26 | message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") | ||
| 27 | endif() | ||
| 28 | endforeach() | ||
| 29 | |||
diff --git a/raylib/src/external/glfw/CMake/glfw3.pc.in b/raylib/src/external/glfw/CMake/glfw3.pc.in new file mode 100644 index 0000000..36ee218 --- /dev/null +++ b/raylib/src/external/glfw/CMake/glfw3.pc.in | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | prefix=@CMAKE_INSTALL_PREFIX@ | ||
| 2 | exec_prefix=${prefix} | ||
| 3 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ | ||
| 4 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ | ||
| 5 | |||
| 6 | Name: GLFW | ||
| 7 | Description: A multi-platform library for OpenGL, window and input | ||
| 8 | Version: @GLFW_VERSION@ | ||
| 9 | URL: https://www.glfw.org/ | ||
| 10 | Requires.private: @GLFW_PKG_CONFIG_REQUIRES_PRIVATE@ | ||
| 11 | Libs: -L${libdir} -l@GLFW_LIB_NAME@@GLFW_LIB_NAME_SUFFIX@ | ||
| 12 | Libs.private: @GLFW_PKG_CONFIG_LIBS_PRIVATE@ | ||
| 13 | Cflags: -I${includedir} | ||
diff --git a/raylib/src/external/glfw/CMake/glfw3Config.cmake.in b/raylib/src/external/glfw/CMake/glfw3Config.cmake.in new file mode 100644 index 0000000..4a13a88 --- /dev/null +++ b/raylib/src/external/glfw/CMake/glfw3Config.cmake.in | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | include(CMakeFindDependencyMacro) | ||
| 2 | find_dependency(Threads) | ||
| 3 | include("${CMAKE_CURRENT_LIST_DIR}/glfw3Targets.cmake") | ||
diff --git a/raylib/src/external/glfw/CMake/i686-w64-mingw32-clang.cmake b/raylib/src/external/glfw/CMake/i686-w64-mingw32-clang.cmake new file mode 100644 index 0000000..8726b23 --- /dev/null +++ b/raylib/src/external/glfw/CMake/i686-w64-mingw32-clang.cmake | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | # Define the environment for cross-compiling with 32-bit MinGW-w64 Clang | ||
| 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name | ||
| 3 | SET(CMAKE_SYSTEM_VERSION 1) | ||
| 4 | SET(CMAKE_C_COMPILER "i686-w64-mingw32-clang") | ||
| 5 | SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-clang++") | ||
| 6 | SET(CMAKE_RC_COMPILER "i686-w64-mingw32-windres") | ||
| 7 | SET(CMAKE_RANLIB "i686-w64-mingw32-ranlib") | ||
| 8 | |||
| 9 | # Configure the behaviour of the find commands | ||
| 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32") | ||
| 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
| 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
| 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
diff --git a/raylib/src/external/glfw/CMake/i686-w64-mingw32.cmake b/raylib/src/external/glfw/CMake/i686-w64-mingw32.cmake new file mode 100644 index 0000000..2ca4dcd --- /dev/null +++ b/raylib/src/external/glfw/CMake/i686-w64-mingw32.cmake | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | # Define the environment for cross-compiling with 32-bit MinGW-w64 GCC | ||
| 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name | ||
| 3 | SET(CMAKE_SYSTEM_VERSION 1) | ||
| 4 | SET(CMAKE_C_COMPILER "i686-w64-mingw32-gcc") | ||
| 5 | SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-g++") | ||
| 6 | SET(CMAKE_RC_COMPILER "i686-w64-mingw32-windres") | ||
| 7 | SET(CMAKE_RANLIB "i686-w64-mingw32-ranlib") | ||
| 8 | |||
| 9 | # Configure the behaviour of the find commands | ||
| 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32") | ||
| 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
| 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
| 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
diff --git a/raylib/src/external/glfw/CMake/modules/FindEpollShim.cmake b/raylib/src/external/glfw/CMake/modules/FindEpollShim.cmake new file mode 100644 index 0000000..f34d070 --- /dev/null +++ b/raylib/src/external/glfw/CMake/modules/FindEpollShim.cmake | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | # Find EpollShim | ||
| 2 | # Once done, this will define | ||
| 3 | # | ||
| 4 | # EPOLLSHIM_FOUND - System has EpollShim | ||
| 5 | # EPOLLSHIM_INCLUDE_DIRS - The EpollShim include directories | ||
| 6 | # EPOLLSHIM_LIBRARIES - The libraries needed to use EpollShim | ||
| 7 | |||
| 8 | find_path(EPOLLSHIM_INCLUDE_DIRS NAMES sys/epoll.h sys/timerfd.h HINTS /usr/local/include/libepoll-shim) | ||
| 9 | find_library(EPOLLSHIM_LIBRARIES NAMES epoll-shim libepoll-shim HINTS /usr/local/lib) | ||
| 10 | |||
| 11 | if (EPOLLSHIM_INCLUDE_DIRS AND EPOLLSHIM_LIBRARIES) | ||
| 12 | set(EPOLLSHIM_FOUND TRUE) | ||
| 13 | endif (EPOLLSHIM_INCLUDE_DIRS AND EPOLLSHIM_LIBRARIES) | ||
| 14 | |||
| 15 | include(FindPackageHandleStandardArgs) | ||
| 16 | find_package_handle_standard_args(EpollShim DEFAULT_MSG EPOLLSHIM_LIBRARIES EPOLLSHIM_INCLUDE_DIRS) | ||
| 17 | mark_as_advanced(EPOLLSHIM_INCLUDE_DIRS EPOLLSHIM_LIBRARIES) | ||
diff --git a/raylib/src/external/glfw/CMake/modules/FindOSMesa.cmake b/raylib/src/external/glfw/CMake/modules/FindOSMesa.cmake new file mode 100644 index 0000000..3194bd9 --- /dev/null +++ b/raylib/src/external/glfw/CMake/modules/FindOSMesa.cmake | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | # Try to find OSMesa on a Unix system | ||
| 2 | # | ||
| 3 | # This will define: | ||
| 4 | # | ||
| 5 | # OSMESA_LIBRARIES - Link these to use OSMesa | ||
| 6 | # OSMESA_INCLUDE_DIR - Include directory for OSMesa | ||
| 7 | # | ||
| 8 | # Copyright (c) 2014 Brandon Schaefer <brandon.schaefer@canonical.com> | ||
| 9 | |||
| 10 | if (NOT WIN32) | ||
| 11 | |||
| 12 | find_package (PkgConfig) | ||
| 13 | pkg_check_modules (PKG_OSMESA QUIET osmesa) | ||
| 14 | |||
| 15 | set (OSMESA_INCLUDE_DIR ${PKG_OSMESA_INCLUDE_DIRS}) | ||
| 16 | set (OSMESA_LIBRARIES ${PKG_OSMESA_LIBRARIES}) | ||
| 17 | |||
| 18 | endif () | ||
diff --git a/raylib/src/external/glfw/CMake/x86_64-w64-mingw32-clang.cmake b/raylib/src/external/glfw/CMake/x86_64-w64-mingw32-clang.cmake new file mode 100644 index 0000000..60f7914 --- /dev/null +++ b/raylib/src/external/glfw/CMake/x86_64-w64-mingw32-clang.cmake | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | # Define the environment for cross-compiling with 64-bit MinGW-w64 Clang | ||
| 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name | ||
| 3 | SET(CMAKE_SYSTEM_VERSION 1) | ||
| 4 | SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-clang") | ||
| 5 | SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-clang++") | ||
| 6 | SET(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres") | ||
| 7 | SET(CMAKE_RANLIB "x86_64-w64-mingw32-ranlib") | ||
| 8 | |||
| 9 | # Configure the behaviour of the find commands | ||
| 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32") | ||
| 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
| 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
| 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
diff --git a/raylib/src/external/glfw/CMake/x86_64-w64-mingw32.cmake b/raylib/src/external/glfw/CMake/x86_64-w64-mingw32.cmake new file mode 100644 index 0000000..063e845 --- /dev/null +++ b/raylib/src/external/glfw/CMake/x86_64-w64-mingw32.cmake | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | # Define the environment for cross-compiling with 64-bit MinGW-w64 GCC | ||
| 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name | ||
| 3 | SET(CMAKE_SYSTEM_VERSION 1) | ||
| 4 | SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-gcc") | ||
| 5 | SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-g++") | ||
| 6 | SET(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres") | ||
| 7 | SET(CMAKE_RANLIB "x86_64-w64-mingw32-ranlib") | ||
| 8 | |||
| 9 | # Configure the behaviour of the find commands | ||
| 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32") | ||
| 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
| 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
| 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
diff --git a/raylib/src/external/glfw/CMakeLists.txt b/raylib/src/external/glfw/CMakeLists.txt new file mode 100644 index 0000000..a3cb1fe --- /dev/null +++ b/raylib/src/external/glfw/CMakeLists.txt | |||
| @@ -0,0 +1,165 @@ | |||
| 1 | cmake_minimum_required(VERSION 3.4...3.28 FATAL_ERROR) | ||
| 2 | |||
| 3 | project(GLFW VERSION 3.4.0 LANGUAGES C) | ||
| 4 | |||
| 5 | if (POLICY CMP0069) | ||
| 6 | cmake_policy(SET CMP0069 NEW) | ||
| 7 | endif() | ||
| 8 | |||
| 9 | if (POLICY CMP0077) | ||
| 10 | cmake_policy(SET CMP0077 NEW) | ||
| 11 | endif() | ||
| 12 | |||
| 13 | set_property(GLOBAL PROPERTY USE_FOLDERS ON) | ||
| 14 | |||
| 15 | string(COMPARE EQUAL "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}" GLFW_STANDALONE) | ||
| 16 | |||
| 17 | option(BUILD_SHARED_LIBS "Build shared libraries" OFF) | ||
| 18 | option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" ${GLFW_STANDALONE}) | ||
| 19 | option(GLFW_BUILD_TESTS "Build the GLFW test programs" ${GLFW_STANDALONE}) | ||
| 20 | option(GLFW_BUILD_DOCS "Build the GLFW documentation" ON) | ||
| 21 | option(GLFW_INSTALL "Generate installation target" ON) | ||
| 22 | |||
| 23 | include(GNUInstallDirs) | ||
| 24 | include(CMakeDependentOption) | ||
| 25 | |||
| 26 | if (GLFW_USE_OSMESA) | ||
| 27 | message(FATAL_ERROR "GLFW_USE_OSMESA has been removed; set the GLFW_PLATFORM init hint") | ||
| 28 | endif() | ||
| 29 | |||
| 30 | if (DEFINED GLFW_USE_WAYLAND AND UNIX AND NOT APPLE) | ||
| 31 | message(FATAL_ERROR | ||
| 32 | "GLFW_USE_WAYLAND has been removed; delete the CMake cache and set GLFW_BUILD_WAYLAND and GLFW_BUILD_X11 instead") | ||
| 33 | endif() | ||
| 34 | |||
| 35 | cmake_dependent_option(GLFW_BUILD_WIN32 "Build support for Win32" ON "WIN32" OFF) | ||
| 36 | cmake_dependent_option(GLFW_BUILD_COCOA "Build support for Cocoa" ON "APPLE" OFF) | ||
| 37 | cmake_dependent_option(GLFW_BUILD_X11 "Build support for X11" ON "UNIX;NOT APPLE" OFF) | ||
| 38 | cmake_dependent_option(GLFW_BUILD_WAYLAND "Build support for Wayland" ON "UNIX;NOT APPLE" OFF) | ||
| 39 | |||
| 40 | cmake_dependent_option(GLFW_USE_HYBRID_HPG "Force use of high-performance GPU on hybrid systems" OFF | ||
| 41 | "WIN32" OFF) | ||
| 42 | cmake_dependent_option(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC runtime library DLL" ON | ||
| 43 | "MSVC" OFF) | ||
| 44 | |||
| 45 | set(GLFW_LIBRARY_TYPE "${GLFW_LIBRARY_TYPE}" CACHE STRING | ||
| 46 | "Library type override for GLFW (SHARED, STATIC, OBJECT, or empty to follow BUILD_SHARED_LIBS)") | ||
| 47 | |||
| 48 | if (GLFW_LIBRARY_TYPE) | ||
| 49 | if (GLFW_LIBRARY_TYPE STREQUAL "SHARED") | ||
| 50 | set(GLFW_BUILD_SHARED_LIBRARY TRUE) | ||
| 51 | else() | ||
| 52 | set(GLFW_BUILD_SHARED_LIBRARY FALSE) | ||
| 53 | endif() | ||
| 54 | else() | ||
| 55 | set(GLFW_BUILD_SHARED_LIBRARY ${BUILD_SHARED_LIBS}) | ||
| 56 | endif() | ||
| 57 | |||
| 58 | list(APPEND CMAKE_MODULE_PATH "${GLFW_SOURCE_DIR}/CMake/modules") | ||
| 59 | |||
| 60 | find_package(Threads REQUIRED) | ||
| 61 | |||
| 62 | #-------------------------------------------------------------------- | ||
| 63 | # Report backend selection | ||
| 64 | #-------------------------------------------------------------------- | ||
| 65 | if (GLFW_BUILD_WIN32) | ||
| 66 | message(STATUS "Including Win32 support") | ||
| 67 | endif() | ||
| 68 | if (GLFW_BUILD_COCOA) | ||
| 69 | message(STATUS "Including Cocoa support") | ||
| 70 | endif() | ||
| 71 | if (GLFW_BUILD_WAYLAND) | ||
| 72 | message(STATUS "Including Wayland support") | ||
| 73 | endif() | ||
| 74 | if (GLFW_BUILD_X11) | ||
| 75 | message(STATUS "Including X11 support") | ||
| 76 | endif() | ||
| 77 | |||
| 78 | #-------------------------------------------------------------------- | ||
| 79 | # Apply Microsoft C runtime library option | ||
| 80 | # This is here because it also applies to tests and examples | ||
| 81 | #-------------------------------------------------------------------- | ||
| 82 | if (MSVC AND NOT USE_MSVC_RUNTIME_LIBRARY_DLL) | ||
| 83 | if (CMAKE_VERSION VERSION_LESS 3.15) | ||
| 84 | foreach (flag CMAKE_C_FLAGS | ||
| 85 | CMAKE_C_FLAGS_DEBUG | ||
| 86 | CMAKE_C_FLAGS_RELEASE | ||
| 87 | CMAKE_C_FLAGS_MINSIZEREL | ||
| 88 | CMAKE_C_FLAGS_RELWITHDEBINFO) | ||
| 89 | |||
| 90 | if (flag MATCHES "/MD") | ||
| 91 | string(REGEX REPLACE "/MD" "/MT" ${flag} "${${flag}}") | ||
| 92 | endif() | ||
| 93 | if (flag MATCHES "/MDd") | ||
| 94 | string(REGEX REPLACE "/MDd" "/MTd" ${flag} "${${flag}}") | ||
| 95 | endif() | ||
| 96 | |||
| 97 | endforeach() | ||
| 98 | else() | ||
| 99 | set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") | ||
| 100 | endif() | ||
| 101 | endif() | ||
| 102 | |||
| 103 | #-------------------------------------------------------------------- | ||
| 104 | # Create generated files | ||
| 105 | #-------------------------------------------------------------------- | ||
| 106 | include(CMakePackageConfigHelpers) | ||
| 107 | |||
| 108 | set(GLFW_CONFIG_PATH "${CMAKE_INSTALL_LIBDIR}/cmake/glfw3") | ||
| 109 | |||
| 110 | configure_package_config_file(CMake/glfw3Config.cmake.in | ||
| 111 | src/glfw3Config.cmake | ||
| 112 | INSTALL_DESTINATION "${GLFW_CONFIG_PATH}" | ||
| 113 | NO_CHECK_REQUIRED_COMPONENTS_MACRO) | ||
| 114 | |||
| 115 | write_basic_package_version_file(src/glfw3ConfigVersion.cmake | ||
| 116 | VERSION ${GLFW_VERSION} | ||
| 117 | COMPATIBILITY SameMajorVersion) | ||
| 118 | |||
| 119 | #-------------------------------------------------------------------- | ||
| 120 | # Add subdirectories | ||
| 121 | #-------------------------------------------------------------------- | ||
| 122 | add_subdirectory(src) | ||
| 123 | |||
| 124 | if (GLFW_BUILD_EXAMPLES) | ||
| 125 | add_subdirectory(examples) | ||
| 126 | endif() | ||
| 127 | |||
| 128 | if (GLFW_BUILD_TESTS) | ||
| 129 | add_subdirectory(tests) | ||
| 130 | endif() | ||
| 131 | |||
| 132 | if (GLFW_BUILD_DOCS) | ||
| 133 | add_subdirectory(docs) | ||
| 134 | endif() | ||
| 135 | |||
| 136 | #-------------------------------------------------------------------- | ||
| 137 | # Install files other than the library | ||
| 138 | # The library is installed by src/CMakeLists.txt | ||
| 139 | #-------------------------------------------------------------------- | ||
| 140 | if (GLFW_INSTALL) | ||
| 141 | install(DIRECTORY include/GLFW DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} | ||
| 142 | FILES_MATCHING PATTERN glfw3.h PATTERN glfw3native.h) | ||
| 143 | |||
| 144 | install(FILES "${GLFW_BINARY_DIR}/src/glfw3Config.cmake" | ||
| 145 | "${GLFW_BINARY_DIR}/src/glfw3ConfigVersion.cmake" | ||
| 146 | DESTINATION "${GLFW_CONFIG_PATH}") | ||
| 147 | |||
| 148 | install(EXPORT glfwTargets FILE glfw3Targets.cmake | ||
| 149 | EXPORT_LINK_INTERFACE_LIBRARIES | ||
| 150 | DESTINATION "${GLFW_CONFIG_PATH}") | ||
| 151 | install(FILES "${GLFW_BINARY_DIR}/src/glfw3.pc" | ||
| 152 | DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") | ||
| 153 | |||
| 154 | # Only generate this target if no higher-level project already has | ||
| 155 | if (NOT TARGET uninstall) | ||
| 156 | configure_file(CMake/cmake_uninstall.cmake.in | ||
| 157 | cmake_uninstall.cmake IMMEDIATE @ONLY) | ||
| 158 | |||
| 159 | add_custom_target(uninstall | ||
| 160 | "${CMAKE_COMMAND}" -P | ||
| 161 | "${GLFW_BINARY_DIR}/cmake_uninstall.cmake") | ||
| 162 | set_target_properties(uninstall PROPERTIES FOLDER "GLFW3") | ||
| 163 | endif() | ||
| 164 | endif() | ||
| 165 | |||
