Commit 375dd6b186b7334b430c1c1dd3992ab43ba64e45

Authored by Enrique Díaz Roque
1 parent baa798a8
Exists in master and in 1 other branch dev

Fixed GLEW bug & Changed to GLFW 303

Showing 397 changed files with 9478 additions and 54243 deletions   Show diff stats

Too many changes.

To preserve performance only 100 of 397 files displayed.

app/lib/glfw/.gitignore 0 → 100644
... ... @@ -0,0 +1,70 @@
  1 +# External junk
  2 +.DS_Store
  3 +_ReSharper*
  4 +*.opensdf
  5 +*.sdf
  6 +*.dir
  7 +*.vcxproj*
  8 +*.sln
  9 +Win32
  10 +Debug
  11 +Release
  12 +
  13 +# CMake files
  14 +Makefile
  15 +CMakeCache.txt
  16 +CMakeFiles
  17 +cmake_install.cmake
  18 +cmake_uninstall.cmake
  19 +
  20 +# Generated files
  21 +docs/Doxyfile
  22 +docs/html
  23 +docs/warnings.txt
  24 +src/config.h
  25 +src/glfw3.pc
  26 +src/glfwConfig.cmake
  27 +src/glfwConfigVersion.cmake
  28 +
  29 +# Compiled binaries
  30 +src/libglfw.so
  31 +src/libglfw.so.3
  32 +src/libglfw.so.3.0
  33 +src/libglfw.dylib
  34 +src/libglfw.dylib
  35 +src/libglfw.3.dylib
  36 +src/libglfw.3.0.dylib
  37 +src/libglfw3.a
  38 +src/glfw3.lib
  39 +src/glfw3.dll
  40 +src/glfw3dll.lib
  41 +src/glfw3dll.a
  42 +examples/*.app
  43 +examples/*.exe
  44 +examples/boing
  45 +examples/gears
  46 +examples/heightmap
  47 +examples/splitview
  48 +examples/simple
  49 +examples/wave
  50 +tests/*.app
  51 +tests/*.exe
  52 +tests/accuracy
  53 +tests/clipboard
  54 +tests/defaults
  55 +tests/events
  56 +tests/fsaa
  57 +tests/gamma
  58 +tests/glfwinfo
  59 +tests/iconify
  60 +tests/joysticks
  61 +tests/modes
  62 +tests/peter
  63 +tests/reopen
  64 +tests/sharing
  65 +tests/tearing
  66 +tests/threads
  67 +tests/title
  68 +tests/version
  69 +tests/windows
  70 +
... ...
app/lib/glfw/CMake/AppleInfo.plist
... ... @@ -1,38 +0,0 @@
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>${APPLE_GUI_EXECUTABLE}</string>
9   - <key>CFBundleGetInfoString</key>
10   - <string>${APPLE_GUI_INFO_STRING}</string>
11   - <key>CFBundleIconFile</key>
12   - <string>${APPLE_GUI_ICON}</string>
13   - <key>CFBundleIdentifier</key>
14   - <string>${APPLE_GUI_IDENTIFIER}</string>
15   - <key>CFBundleInfoDictionaryVersion</key>
16   - <string>6.0</string>
17   - <key>CFBundleLongVersionString</key>
18   - <string>${APPLE_GUI_LONG_VERSION_STRING}</string>
19   - <key>CFBundleName</key>
20   - <string>${APPLE_GUI_BUNDLE_NAME}</string>
21   - <key>CFBundlePackageType</key>
22   - <string>APPL</string>
23   - <key>CFBundleShortVersionString</key>
24   - <string>${APPLE_GUI_SHORT_VERSION_STRING}</string>
25   - <key>CFBundleSignature</key>
26   - <string>????</string>
27   - <key>CFBundleVersion</key>
28   - <string>${APPLE_GUI_BUNDLE_VERSION}</string>
29   - <key>CSResourcesFileMapped</key>
30   - <true/>
31   - <key>LSRequiresCarbon</key>
32   - <true/>
33   - <key>NSHumanReadableCopyright</key>
34   - <string>${APPLE_GUI_COPYRIGHT}</string>
35   - <key>NSHighResolutionCapable</key>
36   - <true/>
37   -</dict>
38   -</plist>
app/lib/glfw/CMake/modules/FindEGL.cmake
... ... @@ -4,10 +4,10 @@
4 4 # EGL_LIBRARY
5 5 # EGL_FOUND
6 6  
7   -find_path(EGL_INCLUDE_DIR NAMES EGL/egl.h PATHS /opt/vc/include)
  7 +find_path(EGL_INCLUDE_DIR NAMES EGL/egl.h)
8 8  
9 9 set(EGL_NAMES ${EGL_NAMES} egl EGL)
10   -find_library(EGL_LIBRARY NAMES ${EGL_NAMES} PATHS /opt/vc/lib)
  10 +find_library(EGL_LIBRARY NAMES ${EGL_NAMES})
11 11  
12 12 include(FindPackageHandleStandardArgs)
13 13 find_package_handle_standard_args(EGL DEFAULT_MSG EGL_LIBRARY EGL_INCLUDE_DIR)
... ...
app/lib/glfw/CMake/modules/FindGLESv1.cmake
... ... @@ -4,10 +4,10 @@
4 4 # GLESv1_LIBRARY
5 5 # GLESv1_FOUND
6 6  
7   -find_path(GLESv1_INCLUDE_DIR NAMES GLES/gl.h PATHS /opt/vc/include)
  7 +find_path(GLESv1_INCLUDE_DIR NAMES GLES/gl.h)
8 8  
9 9 set(GLESv1_NAMES ${GLESv1_NAMES} GLESv1_CM)
10   -find_library(GLESv1_LIBRARY NAMES ${GLESv1_NAMES} PATHS /opt/vc/lib)
  10 +find_library(GLESv1_LIBRARY NAMES ${GLESv1_NAMES})
11 11  
12 12 include(FindPackageHandleStandardArgs)
13 13 find_package_handle_standard_args(GLESv1 DEFAULT_MSG GLESv1_LIBRARY GLESv1_INCLUDE_DIR)
... ...
app/lib/glfw/CMake/modules/FindGLESv2.cmake
... ... @@ -4,10 +4,10 @@
4 4 # GLESv2_LIBRARY
5 5 # GLESv2_FOUND
6 6  
7   -find_path(GLESv2_INCLUDE_DIR NAMES GLES2/gl2.h PATHS /opt/vc/include)
  7 +find_path(GLESv2_INCLUDE_DIR NAMES GLES2/gl2.h)
8 8  
9 9 set(GLESv2_NAMES ${GLESv2_NAMES} GLESv2)
10   -find_library(GLESv2_LIBRARY NAMES ${GLESv2_NAMES} PATHS /opt/vc/lib)
  10 +find_library(GLESv2_LIBRARY NAMES ${GLESv2_NAMES})
11 11  
12 12 include(FindPackageHandleStandardArgs)
13 13 find_package_handle_standard_args(GLESv2 DEFAULT_MSG GLESv2_LIBRARY GLESv2_INCLUDE_DIR)
... ...
app/lib/glfw/CMake/modules/FindMir.cmake
... ... @@ -1,18 +0,0 @@
1   -# Try to find Mir on a Unix system
2   -#
3   -# This will define:
4   -#
5   -# MIR_LIBRARIES - Link these to use Wayland
6   -# MIR_INCLUDE_DIR - Include directory for Wayland
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_MIR QUIET mirclient)
14   -
15   - set (MIR_INCLUDE_DIR ${PKG_MIR_INCLUDE_DIRS})
16   - set (MIR_LIBRARIES ${PKG_MIR_LIBRARIES})
17   -
18   -endif ()
app/lib/glfw/CMake/modules/FindWayland.cmake
... ... @@ -1,66 +0,0 @@
1   -# Try to find Wayland on a Unix system
2   -#
3   -# This will define:
4   -#
5   -# WAYLAND_FOUND - True if Wayland is found
6   -# WAYLAND_LIBRARIES - Link these to use Wayland
7   -# WAYLAND_INCLUDE_DIR - Include directory for Wayland
8   -# WAYLAND_DEFINITIONS - Compiler flags for using Wayland
9   -#
10   -# In addition the following more fine grained variables will be defined:
11   -#
12   -# WAYLAND_CLIENT_FOUND WAYLAND_CLIENT_INCLUDE_DIR WAYLAND_CLIENT_LIBRARIES
13   -# WAYLAND_SERVER_FOUND WAYLAND_SERVER_INCLUDE_DIR WAYLAND_SERVER_LIBRARIES
14   -# WAYLAND_EGL_FOUND WAYLAND_EGL_INCLUDE_DIR WAYLAND_EGL_LIBRARIES
15   -#
16   -# Copyright (c) 2013 Martin Gräßlin <mgraesslin@kde.org>
17   -#
18   -# Redistribution and use is allowed according to the terms of the BSD license.
19   -# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
20   -
21   -IF (NOT WIN32)
22   - IF (WAYLAND_INCLUDE_DIR AND WAYLAND_LIBRARIES)
23   - # In the cache already
24   - SET(WAYLAND_FIND_QUIETLY TRUE)
25   - ENDIF ()
26   -
27   - # Use pkg-config to get the directories and then use these values
28   - # in the FIND_PATH() and FIND_LIBRARY() calls
29   - FIND_PACKAGE(PkgConfig)
30   - PKG_CHECK_MODULES(PKG_WAYLAND QUIET wayland-client wayland-server wayland-egl wayland-cursor)
31   -
32   - SET(WAYLAND_DEFINITIONS ${PKG_WAYLAND_CFLAGS})
33   -
34   - FIND_PATH(WAYLAND_CLIENT_INCLUDE_DIR NAMES wayland-client.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS})
35   - FIND_PATH(WAYLAND_SERVER_INCLUDE_DIR NAMES wayland-server.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS})
36   - FIND_PATH(WAYLAND_EGL_INCLUDE_DIR NAMES wayland-egl.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS})
37   - FIND_PATH(WAYLAND_CURSOR_INCLUDE_DIR NAMES wayland-cursor.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS})
38   -
39   - FIND_LIBRARY(WAYLAND_CLIENT_LIBRARIES NAMES wayland-client HINTS ${PKG_WAYLAND_LIBRARY_DIRS})
40   - FIND_LIBRARY(WAYLAND_SERVER_LIBRARIES NAMES wayland-server HINTS ${PKG_WAYLAND_LIBRARY_DIRS})
41   - FIND_LIBRARY(WAYLAND_EGL_LIBRARIES NAMES wayland-egl HINTS ${PKG_WAYLAND_LIBRARY_DIRS})
42   - FIND_LIBRARY(WAYLAND_CURSOR_LIBRARIES NAMES wayland-cursor HINTS ${PKG_WAYLAND_LIBRARY_DIRS})
43   -
44   - set(WAYLAND_INCLUDE_DIR ${WAYLAND_CLIENT_INCLUDE_DIR} ${WAYLAND_SERVER_INCLUDE_DIR} ${WAYLAND_EGL_INCLUDE_DIR} ${WAYLAND_CURSOR_INCLUDE_DIR})
45   -
46   - set(WAYLAND_LIBRARIES ${WAYLAND_CLIENT_LIBRARIES} ${WAYLAND_SERVER_LIBRARIES} ${WAYLAND_EGL_LIBRARIES} ${WAYLAND_CURSOR_LIBRARIES})
47   -
48   - list(REMOVE_DUPLICATES WAYLAND_INCLUDE_DIR)
49   -
50   - include(FindPackageHandleStandardArgs)
51   -
52   - FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_CLIENT DEFAULT_MSG WAYLAND_CLIENT_LIBRARIES WAYLAND_CLIENT_INCLUDE_DIR)
53   - FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_SERVER DEFAULT_MSG WAYLAND_SERVER_LIBRARIES WAYLAND_SERVER_INCLUDE_DIR)
54   - FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_EGL DEFAULT_MSG WAYLAND_EGL_LIBRARIES WAYLAND_EGL_INCLUDE_DIR)
55   - FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_CURSOR DEFAULT_MSG WAYLAND_CURSOR_LIBRARIES WAYLAND_CURSOR_INCLUDE_DIR)
56   - FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND DEFAULT_MSG WAYLAND_LIBRARIES WAYLAND_INCLUDE_DIR)
57   -
58   - MARK_AS_ADVANCED(
59   - WAYLAND_INCLUDE_DIR WAYLAND_LIBRARIES
60   - WAYLAND_CLIENT_INCLUDE_DIR WAYLAND_CLIENT_LIBRARIES
61   - WAYLAND_SERVER_INCLUDE_DIR WAYLAND_SERVER_LIBRARIES
62   - WAYLAND_EGL_INCLUDE_DIR WAYLAND_EGL_LIBRARIES
63   - WAYLAND_CURSOR_INCLUDE_DIR WAYLAND_CURSOR_LIBRARIES
64   - )
65   -
66   -ENDIF ()
app/lib/glfw/CMake/modules/FindXKBCommon.cmake
... ... @@ -1,34 +0,0 @@
1   -# - Try to find XKBCommon
2   -# Once done, this will define
3   -#
4   -# XKBCOMMON_FOUND - System has XKBCommon
5   -# XKBCOMMON_INCLUDE_DIRS - The XKBCommon include directories
6   -# XKBCOMMON_LIBRARIES - The libraries needed to use XKBCommon
7   -# XKBCOMMON_DEFINITIONS - Compiler switches required for using XKBCommon
8   -
9   -find_package(PkgConfig)
10   -pkg_check_modules(PC_XKBCOMMON QUIET xkbcommon)
11   -set(XKBCOMMON_DEFINITIONS ${PC_XKBCOMMON_CFLAGS_OTHER})
12   -
13   -find_path(XKBCOMMON_INCLUDE_DIR
14   - NAMES xkbcommon/xkbcommon.h
15   - HINTS ${PC_XKBCOMMON_INCLUDE_DIR} ${PC_XKBCOMMON_INCLUDE_DIRS}
16   -)
17   -
18   -find_library(XKBCOMMON_LIBRARY
19   - NAMES xkbcommon
20   - HINTS ${PC_XKBCOMMON_LIBRARY} ${PC_XKBCOMMON_LIBRARY_DIRS}
21   -)
22   -
23   -set(XKBCOMMON_LIBRARIES ${XKBCOMMON_LIBRARY})
24   -set(XKBCOMMON_LIBRARY_DIRS ${XKBCOMMON_LIBRARY_DIRS})
25   -set(XKBCOMMON_INCLUDE_DIRS ${XKBCOMMON_INCLUDE_DIR})
26   -
27   -include(FindPackageHandleStandardArgs)
28   -find_package_handle_standard_args(XKBCommon DEFAULT_MSG
29   - XKBCOMMON_LIBRARY
30   - XKBCOMMON_INCLUDE_DIR
31   -)
32   -
33   -mark_as_advanced(XKBCOMMON_LIBRARY XKBCOMMON_INCLUDE_DIR)
34   -
app/lib/glfw/CMakeLists.txt
1 1 project(GLFW C)
2 2  
3   -cmake_minimum_required(VERSION 2.8.9)
4   -
5   -if (CMAKE_VERSION VERSION_EQUAL "3.0" OR CMAKE_VERSION VERSION_GREATER "3.0")
6   - # Until all major package systems have moved to CMake 3,
7   - # we stick with the older INSTALL_NAME_DIR mechanism
8   - cmake_policy(SET CMP0042 OLD)
9   -endif()
  3 +cmake_minimum_required(VERSION 2.8)
10 4  
11 5 set(GLFW_VERSION_MAJOR "3")
12   -set(GLFW_VERSION_MINOR "1")
13   -set(GLFW_VERSION_PATCH "1")
  6 +set(GLFW_VERSION_MINOR "0")
  7 +set(GLFW_VERSION_PATCH "3")
14 8 set(GLFW_VERSION_EXTRA "")
15 9 set(GLFW_VERSION "${GLFW_VERSION_MAJOR}.${GLFW_VERSION_MINOR}")
16 10 set(GLFW_VERSION_FULL "${GLFW_VERSION}.${GLFW_VERSION_PATCH}${GLFW_VERSION_EXTRA}")
17 11 set(LIB_SUFFIX "" CACHE STRING "Takes an empty string or 64. Directory where lib will be installed: lib or lib64")
18 12  
19   -set_property(GLOBAL PROPERTY USE_FOLDERS ON)
20   -
21 13 option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
22   -option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" ON)
23   -option(GLFW_BUILD_TESTS "Build the GLFW test programs" ON)
24   -option(GLFW_BUILD_DOCS "Build the GLFW documentation" ON)
  14 +option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" OFF)
  15 +option(GLFW_BUILD_TESTS "Build the GLFW test programs" OFF)
25 16 option(GLFW_INSTALL "Generate installation target" ON)
26 17 option(GLFW_DOCUMENT_INTERNALS "Include internals in documentation" OFF)
27 18  
... ... @@ -34,16 +25,10 @@ if (APPLE)
34 25 option(GLFW_BUILD_UNIVERSAL "Build GLFW as a Universal Binary" OFF)
35 26 option(GLFW_USE_CHDIR "Make glfwInit chdir to Contents/Resources" ON)
36 27 option(GLFW_USE_MENUBAR "Populate the menu bar on first window creation" ON)
37   - option(GLFW_USE_RETINA "Use the full resolution of Retina displays" ON)
38 28 else()
39 29 option(GLFW_USE_EGL "Use EGL for context creation" OFF)
40 30 endif()
41 31  
42   -if (UNIX AND NOT APPLE)
43   - option(GLFW_USE_WAYLAND "Use Wayland for context creation (implies EGL as well)" OFF)
44   - option(GLFW_USE_MIR "Use Mir for context creation (implies EGL as well)" OFF)
45   -endif()
46   -
47 32 if (MSVC)
48 33 option(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC runtime library DLL" ON)
49 34 endif()
... ... @@ -52,12 +37,6 @@ if (BUILD_SHARED_LIBS)
52 37 set(_GLFW_BUILD_DLL 1)
53 38 endif()
54 39  
55   -if (GLFW_USE_WAYLAND)
56   - set(GLFW_USE_EGL ON)
57   -elseif (GLFW_USE_MIR)
58   - set(GLFW_USE_EGL ON)
59   -endif()
60   -
61 40 if (GLFW_USE_EGL)
62 41 set(GLFW_CLIENT_LIBRARY "opengl" CACHE STRING
63 42 "The client library to use; one of opengl, glesv1 or glesv2")
... ... @@ -72,7 +51,7 @@ if (GLFW_USE_EGL)
72 51 message(FATAL_ERROR "Unsupported client library")
73 52 endif()
74 53  
75   - set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMake/modules")
  54 + set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake/modules)
76 55 find_package(EGL REQUIRED)
77 56  
78 57 if (NOT _GLFW_USE_OPENGL)
... ... @@ -94,20 +73,18 @@ endif()
94 73  
95 74 find_package(Threads REQUIRED)
96 75  
97   -if (GLFW_BUILD_DOCS)
98   - set(DOXYGEN_SKIP_DOT TRUE)
99   - find_package(Doxygen)
  76 +set(DOXYGEN_SKIP_DOT TRUE)
  77 +find_package(Doxygen)
100 78  
101   - if (GLFW_DOCUMENT_INTERNALS)
102   - set(GLFW_INTERNAL_DOCS "${GLFW_SOURCE_DIR}/src/internal.h ${GLFW_SOURCE_DIR}/docs/internal.dox")
103   - endif()
  79 +if (GLFW_DOCUMENT_INTERNALS)
  80 + set(GLFW_INTERNAL_DOCS "${GLFW_SOURCE_DIR}/src/internal.h ${GLFW_SOURCE_DIR}/docs/internal.dox")
104 81 endif()
105 82  
106 83 #--------------------------------------------------------------------
107 84 # Set compiler specific flags
108 85 #--------------------------------------------------------------------
109 86 if (UNIX)
110   - add_definitions(-Wall)
  87 + add_definitions(-Wall -D_GNU_SOURCE)
111 88  
112 89 if (BUILD_SHARED_LIBS)
113 90 add_definitions(-fvisibility=hidden)
... ... @@ -135,39 +112,12 @@ if (MSVC)
135 112 endif()
136 113 endif()
137 114  
138   -if (MINGW)
139   - # Enable link-time exploit mitigation features enabled by default on MSVC
140   -
141   - include(CheckCCompilerFlag)
142   -
143   - # Compatibility with data execution prevention (DEP)
144   - set(CMAKE_REQUIRED_FLAGS "-Wl,--nxcompat")
145   - check_c_compiler_flag("" _GLFW_HAS_DEP)
146   - if (_GLFW_HAS_DEP)
147   - set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--nxcompat ${CMAKE_SHARED_LINKER_FLAGS}")
148   - endif()
149   -
150   - # Compatibility with address space layout randomization (ASLR)
151   - set(CMAKE_REQUIRED_FLAGS "-Wl,--dynamicbase")
152   - check_c_compiler_flag("" _GLFW_HAS_ASLR)
153   - if (_GLFW_HAS_ASLR)
154   - set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--dynamicbase ${CMAKE_SHARED_LINKER_FLAGS}")
155   - endif()
156   -
157   - # Compatibility with 64-bit address space layout randomization (ASLR)
158   - set(CMAKE_REQUIRED_FLAGS "-Wl,--high-entropy-va")
159   - check_c_compiler_flag("" _GLFW_HAS_64ASLR)
160   - if (_GLFW_HAS_64ASLR)
161   - set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--high-entropy-va ${CMAKE_SHARED_LINKER_FLAGS}")
162   - endif()
163   -endif()
164   -
165 115 #--------------------------------------------------------------------
166 116 # Detect and select backend APIs
167 117 #--------------------------------------------------------------------
168 118 if (WIN32)
169 119 set(_GLFW_WIN32 1)
170   - message(STATUS "Using Win32 for window creation")
  120 + message(STATUS "Using Win32 for window creation")
171 121  
172 122 if (GLFW_USE_EGL)
173 123 set(_GLFW_EGL 1)
... ... @@ -182,16 +132,8 @@ elseif (APPLE)
182 132 set(_GLFW_NSGL 1)
183 133 message(STATUS "Using NSGL for context creation")
184 134 elseif (UNIX)
185   - if (GLFW_USE_WAYLAND)
186   - set(_GLFW_WAYLAND 1)
187   - message(STATUS "Using Wayland for window creation")
188   - elseif (GLFW_USE_MIR)
189   - set(_GLFW_MIR 1)
190   - message(STATUS "Using Mir for window creation")
191   - else()
192   - set(_GLFW_X11 1)
193   - message(STATUS "Using X11 for window creation")
194   - endif()
  135 + set(_GLFW_X11 1)
  136 + message(STATUS "Using X11 for window creation")
195 137  
196 138 if (GLFW_USE_EGL)
197 139 set(_GLFW_EGL 1)
... ... @@ -208,8 +150,12 @@ endif()
208 150 # Use Win32 for window creation
209 151 #--------------------------------------------------------------------
210 152 if (_GLFW_WIN32)
211   -
212   - list(APPEND glfw_PKG_LIBS "-lgdi32")
  153 + # The DLL links against winmm; the static library loads it
  154 + # That way, both code paths receive testing
  155 + if (BUILD_SHARED_LIBS)
  156 + set(_GLFW_NO_DLOAD_WINMM 1)
  157 + list(APPEND glfw_LIBRARIES winmm)
  158 + endif()
213 159  
214 160 if (GLFW_USE_DWM_SWAP_INTERVAL)
215 161 set(_GLFW_USE_DWM_SWAP_INTERVAL 1)
... ... @@ -222,20 +168,16 @@ if (_GLFW_WIN32)
222 168 # the inclusion of stddef.h (by glfw3.h), which is itself included before
223 169 # win32_platform.h. We define them here until a saner solution can be found
224 170 # NOTE: MinGW-w64 and Visual C++ do /not/ need this hack.
225   - if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
226   - add_definitions(-DUNICODE -DWINVER=0x0501)
227   - endif()
  171 + add_definitions(-DUNICODE)
  172 + add_definitions(-DWINVER=0x0501)
228 173 endif()
229 174  
230 175 #--------------------------------------------------------------------
231 176 # Use WGL for context creation
232 177 #--------------------------------------------------------------------
233 178 if (_GLFW_WGL)
234   -
235   - list(APPEND glfw_PKG_LIBS "-lopengl32")
236   -
237   - list(APPEND glfw_INCLUDE_DIRS "${OPENGL_INCLUDE_DIR}")
238   - list(APPEND glfw_LIBRARIES "${OPENGL_gl_LIBRARY}")
  179 + list(APPEND glfw_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR})
  180 + list(APPEND glfw_LIBRARIES ${OPENGL_gl_LIBRARY})
239 181 endif()
240 182  
241 183 #--------------------------------------------------------------------
... ... @@ -245,13 +187,13 @@ if (_GLFW_X11)
245 187  
246 188 find_package(X11 REQUIRED)
247 189  
248   - list(APPEND glfw_PKG_DEPS "x11")
  190 + set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} x11")
249 191  
250 192 # Set up library and include paths
251   - list(APPEND glfw_INCLUDE_DIRS "${X11_X11_INCLUDE_PATH}")
252   - list(APPEND glfw_LIBRARIES "${X11_X11_LIB}" "${CMAKE_THREAD_LIBS_INIT}")
  193 + list(APPEND glfw_INCLUDE_DIRS ${X11_X11_INCLUDE_PATH})
  194 + list(APPEND glfw_LIBRARIES ${X11_X11_LIB} ${CMAKE_THREAD_LIBS_INIT})
253 195 if (UNIX AND NOT APPLE)
254   - list(APPEND glfw_LIBRARIES "${RT_LIBRARY}")
  196 + list(APPEND glfw_LIBRARIES ${RT_LIBRARY})
255 197 endif()
256 198  
257 199 # Check for XRandR (modern resolution switching and gamma control)
... ... @@ -259,125 +201,61 @@ if (_GLFW_X11)
259 201 message(FATAL_ERROR "The RandR library and headers were not found")
260 202 endif()
261 203  
262   - list(APPEND glfw_INCLUDE_DIRS "${X11_Xrandr_INCLUDE_PATH}")
263   - list(APPEND glfw_LIBRARIES "${X11_Xrandr_LIB}")
264   - list(APPEND glfw_PKG_DEPS "xrandr")
265   -
266   - # Check for Xinerama (legacy multi-monitor support)
267   - if (NOT X11_Xinerama_FOUND)
268   - message(FATAL_ERROR "The Xinerama library and headers were not found")
269   - endif()
270   -
271   - list(APPEND glfw_INCLUDE_DIRS "${X11_Xinerama_INCLUDE_PATH}")
272   - list(APPEND glfw_LIBRARIES "${X11_Xinerama_LIB}")
273   - list(APPEND glfw_PKG_DEPS "xinerama")
  204 + list(APPEND glfw_INCLUDE_DIRS ${X11_Xrandr_INCLUDE_PATH})
  205 + list(APPEND glfw_LIBRARIES ${X11_Xrandr_LIB})
  206 + set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} xrandr")
274 207  
275 208 # Check for XInput (high-resolution cursor motion)
276   - if (X11_Xinput_FOUND)
277   - list(APPEND glfw_INCLUDE_DIRS "${X11_Xinput_INCLUDE_PATH}")
278   - list(APPEND glfw_PKG_DEPS "xi")
  209 + if (NOT X11_Xinput_FOUND)
  210 + message(FATAL_ERROR "The XInput library and headers were not found")
  211 + endif()
279 212  
280   - if (X11_Xinput_LIB)
281   - list(APPEND glfw_LIBRARIES "${X11_Xinput_LIB}")
282   - else()
283   - # Backwards compatibility (bug in CMake 2.8.7)
284   - list(APPEND glfw_LIBRARIES Xi)
285   - endif()
  213 + list(APPEND glfw_INCLUDE_DIRS ${X11_Xinput_INCLUDE_PATH})
286 214  
287   - set(_GLFW_HAS_XINPUT TRUE)
  215 + if (X11_Xinput_LIB)
  216 + list(APPEND glfw_LIBRARIES ${X11_Xinput_LIB})
  217 + else()
  218 + # Backwards compatibility (bug in CMake 2.8.7)
  219 + list(APPEND glfw_LIBRARIES Xi)
288 220 endif()
  221 + set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} xi")
289 222  
290 223 # Check for Xf86VidMode (fallback gamma control)
291   - if (X11_xf86vmode_FOUND)
292   - list(APPEND glfw_INCLUDE_DIRS "${X11_xf86vmode_INCLUDE_PATH}")
293   - list(APPEND glfw_PKG_DEPS "xxf86vm")
  224 + if (NOT X11_xf86vmode_FOUND)
  225 + message(FATAL_ERROR "The Xf86VidMode library and headers were not found")
  226 + endif()
294 227  
295   - if (X11_Xxf86vm_LIB)
296   - list(APPEND glfw_LIBRARIES "${X11_Xxf86vm_LIB}")
297   - else()
298   - # Backwards compatibility (see CMake bug 0006976)
299   - list(APPEND glfw_LIBRARIES Xxf86vm)
300   - endif()
  228 + list(APPEND glfw_INCLUDE_DIRS ${X11_xf86vmode_INCLUDE_PATH})
  229 + set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} xxf86vm")
301 230  
302   - set(_GLFW_HAS_XF86VM TRUE)
  231 + if (X11_Xxf86vm_LIB)
  232 + list(APPEND glfw_LIBRARIES ${X11_Xxf86vm_LIB})
  233 + else()
  234 + # Backwards compatibility (see CMake bug 0006976)
  235 + list(APPEND glfw_LIBRARIES Xxf86vm)
303 236 endif()
304 237  
305 238 # Check for Xkb (X keyboard extension)
306 239 if (NOT X11_Xkb_FOUND)
307 240 message(FATAL_ERROR "The X keyboard extension headers were not found")
308   - endif()
  241 + endif()
309 242  
310   - list(APPEND glfw_INCLUDE_DIR "${X11_Xkb_INCLUDE_PATH}")
  243 + list(APPEND glfw_INCLUDE_DIR ${X11_Xkb_INCLUDE_PATH})
311 244  
312 245 find_library(RT_LIBRARY rt)
313 246 mark_as_advanced(RT_LIBRARY)
314 247 if (RT_LIBRARY)
315   - list(APPEND glfw_LIBRARIES "${RT_LIBRARY}")
316   - list(APPEND glfw_PKG_LIBS "-lrt")
  248 + list(APPEND glfw_LIBRARIES ${RT_LIBRARY})
  249 + set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -lrt")
317 250 endif()
318 251  
319 252 find_library(MATH_LIBRARY m)
320 253 mark_as_advanced(MATH_LIBRARY)
321 254 if (MATH_LIBRARY)
322   - list(APPEND glfw_LIBRARIES "${MATH_LIBRARY}")
323   - list(APPEND glfw_PKG_LIBS "-lm")
  255 + list(APPEND glfw_LIBRARIES ${MATH_LIBRARY})
  256 + set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -lm")
324 257 endif()
325 258  
326   - # Check for Xcursor
327   - if (NOT X11_Xcursor_FOUND)
328   - message(FATAL_ERROR "The Xcursor libraries and headers were not found")
329   - endif()
330   -
331   - list(APPEND glfw_INCLUDE_DIR "${X11_Xcursor_INCLUDE_PATH}")
332   - list(APPEND glfw_LIBRARIES "${X11_Xcursor_LIB}")
333   - list(APPEND glfw_PKG_DEPS "xcursor")
334   -
335   -endif()
336   -
337   -#--------------------------------------------------------------------
338   -# Use Wayland for window creation
339   -#--------------------------------------------------------------------
340   -if (_GLFW_WAYLAND)
341   - find_package(Wayland REQUIRED)
342   - list(APPEND glfw_PKG_DEPS "wayland-egl")
343   -
344   - list(APPEND glfw_INCLUDE_DIRS "${WAYLAND_INCLUDE_DIR}")
345   - list(APPEND glfw_LIBRARIES "${WAYLAND_LIBRARIES}" "${CMAKE_THREAD_LIBS_INIT}")
346   -
347   - find_package(XKBCommon REQUIRED)
348   - list(APPEND glfw_PKG_DEPS "xkbcommon")
349   - list(APPEND glfw_INCLUDE_DIRS "${XKBCOMMON_INCLUDE_DIRS}")
350   - list(APPEND glfw_LIBRARIES "${XKBCOMMON_LIBRARY}")
351   -
352   - find_library(MATH_LIBRARY m)
353   - mark_as_advanced(MATH_LIBRARY)
354   - if (MATH_LIBRARY)
355   - list(APPEND glfw_LIBRARIES "${MATH_LIBRARY}")
356   - list(APPEND glfw_PKG_LIBS "-lm")
357   - endif()
358   -endif()
359   -
360   -#--------------------------------------------------------------------
361   -# Use Mir for window creation
362   -#--------------------------------------------------------------------
363   -if (_GLFW_MIR)
364   - find_package(Mir REQUIRED)
365   - list(APPEND glfw_PKG_DEPS "mirclient")
366   -
367   - list(APPEND glfw_INCLUDE_DIRS "${MIR_INCLUDE_DIR}")
368   - list(APPEND glfw_LIBRARIES "${MIR_LIBRARIES}" "${CMAKE_THREAD_LIBS_INIT}")
369   -
370   - find_package(XKBCommon REQUIRED)
371   - list(APPEND glfw_PKG_DEPS "xkbcommon")
372   - list(APPEND glfw_INCLUDE_DIRS "${XKBCOMMON_INCLUDE_DIRS}")
373   - list(APPEND glfw_LIBRARIES "${XKBCOMMON_LIBRARY}")
374   -
375   - find_library(MATH_LIBRARY m)
376   - mark_as_advanced(MATH_LIBRARY)
377   - if (MATH_LIBRARY)
378   - list(APPEND glfw_LIBRARIES "${MATH_LIBRARY}")
379   - list(APPEND glfw_PKG_LIBS "-lm")
380   - endif()
381 259 endif()
382 260  
383 261 #--------------------------------------------------------------------
... ... @@ -385,14 +263,14 @@ endif()
385 263 #--------------------------------------------------------------------
386 264 if (_GLFW_GLX)
387 265  
388   - list(APPEND glfw_INCLUDE_DIRS "${OPENGL_INCLUDE_DIR}")
389   - list(APPEND glfw_LIBRARIES "${OPENGL_gl_LIBRARY}")
  266 + list(APPEND glfw_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR})
  267 + list(APPEND glfw_LIBRARIES ${OPENGL_gl_LIBRARY})
390 268  
391   - list(APPEND glfw_PKG_DEPS "gl")
  269 + set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} gl")
392 270  
393 271 include(CheckFunctionExists)
394 272  
395   - set(CMAKE_REQUIRED_LIBRARIES "${OPENGL_gl_LIBRARY}")
  273 + set(CMAKE_REQUIRED_LIBRARIES ${OPENGL_gl_LIBRARY})
396 274 check_function_exists(glXGetProcAddress _GLFW_HAS_GLXGETPROCADDRESS)
397 275 check_function_exists(glXGetProcAddressARB _GLFW_HAS_GLXGETPROCADDRESSARB)
398 276 check_function_exists(glXGetProcAddressEXT _GLFW_HAS_GLXGETPROCADDRESSEXT)
... ... @@ -404,15 +282,23 @@ if (_GLFW_GLX)
404 282  
405 283 # Check for dlopen support as a fallback
406 284  
407   - set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_DL_LIBS}")
  285 + find_library(DL_LIBRARY dl)
  286 + mark_as_advanced(DL_LIBRARY)
  287 + if (DL_LIBRARY)
  288 + set(CMAKE_REQUIRED_LIBRARIES ${DL_LIBRARY})
  289 + else()
  290 + set(CMAKE_REQUIRED_LIBRARIES "")
  291 + endif()
  292 +
408 293 check_function_exists(dlopen _GLFW_HAS_DLOPEN)
  294 +
409 295 if (NOT _GLFW_HAS_DLOPEN)
410 296 message(FATAL_ERROR "No entry point retrieval mechanism found")
411 297 endif()
412 298  
413   - if (CMAKE_DL_LIBS)
414   - list(APPEND glfw_LIBRARIES "${CMAKE_DL_LIBS}")
415   - list(APPEND glfw_PKG_LIBS "-l${CMAKE_DL_LIBS}")
  299 + if (DL_LIBRARY)
  300 + list(APPEND glfw_LIBRARIES ${DL_LIBRARY})
  301 + set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -ldl")
416 302 endif()
417 303 endif()
418 304  
... ... @@ -423,23 +309,25 @@ endif()
423 309 #--------------------------------------------------------------------
424 310 if (_GLFW_EGL)
425 311  
426   - list(APPEND glfw_INCLUDE_DIRS "${EGL_INCLUDE_DIR}")
427   - list(APPEND glfw_LIBRARIES "${EGL_LIBRARY}")
  312 + list(APPEND glfw_INCLUDE_DIRS ${EGL_INCLUDE_DIR})
  313 + list(APPEND glfw_LIBRARIES ${EGL_LIBRARY})
428 314  
429   - list(APPEND glfw_PKG_DEPS "egl")
  315 + if (UNIX)
  316 + set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} egl")
  317 + endif()
430 318  
431 319 if (_GLFW_USE_OPENGL)
432   - list(APPEND glfw_LIBRARIES "${OPENGL_gl_LIBRARY}")
433   - list(APPEND glfw_INCLUDE_DIRS "${OPENGL_INCLUDE_DIR}")
434   - list(APPEND glfw_PKG_DEPS "gl")
  320 + list(APPEND glfw_LIBRARIES ${OPENGL_gl_LIBRARY})
  321 + list(APPEND glfw_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR})
  322 + set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} gl")
435 323 elseif (_GLFW_USE_GLESV1)
436   - list(APPEND glfw_LIBRARIES "${GLESv1_LIBRARY}")
437   - list(APPEND glfw_INCLUDE_DIRS "${GLESv1_INCLUDE_DIR}")
438   - list(APPEND glfw_PKG_DEPS "glesv1_cm")
  324 + list(APPEND glfw_LIBRARIES ${GLESv1_LIBRARY})
  325 + list(APPEND glfw_INCLUDE_DIRS ${GLESv1_INCLUDE_DIR})
  326 + set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} glesv1_cm")
439 327 elseif (_GLFW_USE_GLESV2)
440   - list(APPEND glfw_LIBRARIES "${GLESv2_LIBRARY}")
441   - list(APPEND glfw_INCLUDE_DIRS "${GLESv2_INCLUDE_DIR}")
442   - list(APPEND glfw_PKG_DEPS "glesv2")
  328 + list(APPEND glfw_LIBRARIES ${GLESv2_LIBRARY})
  329 + list(APPEND glfw_INCLUDE_DIRS ${GLESv2_INCLUDE_DIR})
  330 + set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} glesv2")
443 331 endif()
444 332  
445 333 endif()
... ... @@ -448,7 +336,7 @@ endif()
448 336 # Use Cocoa for window creation and NSOpenGL for context creation
449 337 #--------------------------------------------------------------------
450 338 if (_GLFW_COCOA AND _GLFW_NSGL)
451   -
  339 +
452 340 if (GLFW_USE_MENUBAR)
453 341 set(_GLFW_USE_MENUBAR 1)
454 342 endif()
... ... @@ -457,46 +345,30 @@ if (_GLFW_COCOA AND _GLFW_NSGL)
457 345 set(_GLFW_USE_CHDIR 1)
458 346 endif()
459 347  
460   - if (GLFW_USE_RETINA)
461   - set(_GLFW_USE_RETINA 1)
462   - endif()
463   -
464 348 if (GLFW_BUILD_UNIVERSAL)
465 349 message(STATUS "Building GLFW as Universal Binaries")
466 350 set(CMAKE_OSX_ARCHITECTURES i386;x86_64)
467 351 else()
468 352 message(STATUS "Building GLFW only for the native architecture")
469 353 endif()
470   -
  354 +
471 355 # Set up library and include paths
472 356 find_library(COCOA_FRAMEWORK Cocoa)
473 357 find_library(IOKIT_FRAMEWORK IOKit)
474 358 find_library(CORE_FOUNDATION_FRAMEWORK CoreFoundation)
475   - find_library(CORE_VIDEO_FRAMEWORK CoreVideo)
476   - mark_as_advanced(COCOA_FRAMEWORK
477   - IOKIT_FRAMEWORK
478   - CORE_FOUNDATION_FRAMEWORK
479   - CORE_VIDEO_FRAMEWORK)
480   - list(APPEND glfw_LIBRARIES "${COCOA_FRAMEWORK}"
481   - "${OPENGL_gl_LIBRARY}"
482   - "${IOKIT_FRAMEWORK}"
483   - "${CORE_FOUNDATION_FRAMEWORK}"
484   - "${CORE_VIDEO_FRAMEWORK}")
485   -
486   - set(glfw_PKG_DEPS "")
487   - set(glfw_PKG_LIBS "-framework Cocoa -framework OpenGL -framework IOKit -framework CoreFoundation -framework CoreVideo")
  359 + list(APPEND glfw_LIBRARIES ${COCOA_FRAMEWORK}
  360 + ${OPENGL_gl_LIBRARY}
  361 + ${IOKIT_FRAMEWORK}
  362 + ${CORE_FOUNDATION_FRAMEWORK})
  363 +
  364 + set(GLFW_PKG_DEPS "")
  365 + set(GLFW_PKG_LIBS "-framework Cocoa -framework OpenGL -framework IOKit -framework CoreFoundation")
488 366 endif()
489 367  
490 368 #--------------------------------------------------------------------
491 369 # Export GLFW library dependencies
492 370 #--------------------------------------------------------------------
493 371 set(GLFW_LIBRARIES ${glfw_LIBRARIES} CACHE STRING "Dependencies of GLFW")
494   -foreach(arg ${glfw_PKG_DEPS})
495   - set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} ${arg}")
496   -endforeach()
497   -foreach(arg ${glfw_PKG_LIBS})
498   - set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} ${arg}")
499   -endforeach()
500 372  
501 373 #--------------------------------------------------------------------
502 374 # Choose library output name
... ... @@ -511,35 +383,23 @@ endif()
511 383 #--------------------------------------------------------------------
512 384 # Create generated files
513 385 #--------------------------------------------------------------------
514   -include(CMakePackageConfigHelpers)
  386 +configure_file(${GLFW_SOURCE_DIR}/docs/Doxyfile.in
  387 + ${GLFW_BINARY_DIR}/docs/Doxyfile @ONLY)
515 388  
516   -if (UNIX)
517   - set(GLFW_CONFIG_PATH "${CMAKE_INSTALL_PREFIX}/lib/cmake/glfw3/")
518   -else()
519   - set(GLFW_CONFIG_PATH "${CMAKE_INSTALL_PREFIX}/")
520   -endif()
  389 +configure_file(${GLFW_SOURCE_DIR}/src/config.h.in
  390 + ${GLFW_BINARY_DIR}/src/config.h @ONLY)
521 391  
522   -configure_package_config_file("${GLFW_SOURCE_DIR}/src/glfw3Config.cmake.in"
523   - "${GLFW_BINARY_DIR}/src/glfw3Config.cmake"
524   - INSTALL_DESTINATION "${GLFW_CONFIG_PATH}"
525   - PATH_VARS CMAKE_INSTALL_PREFIX
526   - NO_CHECK_REQUIRED_COMPONENTS_MACRO)
  392 +configure_file(${GLFW_SOURCE_DIR}/src/glfwConfig.cmake.in
  393 + ${GLFW_BINARY_DIR}/src/glfwConfig.cmake @ONLY)
527 394  
528   -write_basic_package_version_file("${GLFW_BINARY_DIR}/src/glfw3ConfigVersion.cmake"
529   - VERSION ${GLFW_VERSION_FULL}
530   - COMPATIBILITY SameMajorVersion)
  395 +configure_file(${GLFW_SOURCE_DIR}/src/glfwConfigVersion.cmake.in
  396 + ${GLFW_BINARY_DIR}/src/glfwConfigVersion.cmake @ONLY)
531 397  
532   -if (GLFW_BUILD_DOCS)
533   - configure_file("${GLFW_SOURCE_DIR}/docs/Doxyfile.in"
534   - "${GLFW_BINARY_DIR}/docs/Doxyfile" @ONLY)
  398 +if (UNIX)
  399 + configure_file(${GLFW_SOURCE_DIR}/src/glfw3.pc.in
  400 + ${GLFW_BINARY_DIR}/src/glfw3.pc @ONLY)
535 401 endif()
536 402  
537   -configure_file("${GLFW_SOURCE_DIR}/src/glfw_config.h.in"
538   - "${GLFW_BINARY_DIR}/src/glfw_config.h" @ONLY)
539   -
540   -configure_file("${GLFW_SOURCE_DIR}/src/glfw3.pc.in"
541   - "${GLFW_BINARY_DIR}/src/glfw3.pc" @ONLY)
542   -
543 403 #--------------------------------------------------------------------
544 404 # Add subdirectories
545 405 #--------------------------------------------------------------------
... ... @@ -553,7 +413,7 @@ if (GLFW_BUILD_TESTS)
553 413 add_subdirectory(tests)
554 414 endif()
555 415  
556   -if (DOXYGEN_FOUND AND GLFW_BUILD_DOCS)
  416 +if (DOXYGEN_FOUND)
557 417 add_subdirectory(docs)
558 418 endif()
559 419  
... ... @@ -562,25 +422,27 @@ endif()
562 422 # The library is installed by src/CMakeLists.txt
563 423 #--------------------------------------------------------------------
564 424 if (GLFW_INSTALL)
565   - install(DIRECTORY include/GLFW DESTINATION include
  425 + install(DIRECTORY include/GLFW DESTINATION include
566 426 FILES_MATCHING PATTERN glfw3.h PATTERN glfw3native.h)
567 427  
568   - install(FILES "${GLFW_BINARY_DIR}/src/glfw3Config.cmake"
569   - "${GLFW_BINARY_DIR}/src/glfw3ConfigVersion.cmake"
  428 + install(FILES ${GLFW_BINARY_DIR}/src/glfwConfig.cmake
  429 + ${GLFW_BINARY_DIR}/src/glfwConfigVersion.cmake
570 430 DESTINATION lib${LIB_SUFFIX}/cmake/glfw)
571 431  
572   - install(EXPORT glfwTargets DESTINATION lib${LIB_SUFFIX}/cmake/glfw)
573   - install(FILES "${GLFW_BINARY_DIR}/src/glfw3.pc"
574   - DESTINATION lib${LIB_SUFFIX}/pkgconfig)
  432 + if (UNIX)
  433 + install(EXPORT glfwTargets DESTINATION lib${LIB_SUFFIX}/cmake/glfw)
  434 + install(FILES ${GLFW_BINARY_DIR}/src/glfw3.pc
  435 + DESTINATION lib${LIB_SUFFIX}/pkgconfig)
  436 + endif()
575 437  
576 438 # Only generate this target if no higher-level project already has
577 439 if (NOT TARGET uninstall)
578   - configure_file("${GLFW_SOURCE_DIR}/cmake_uninstall.cmake.in"
579   - "${GLFW_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY)
  440 + configure_file(${GLFW_SOURCE_DIR}/cmake_uninstall.cmake.in
  441 + ${GLFW_BINARY_DIR}/cmake_uninstall.cmake IMMEDIATE @ONLY)
580 442  
581 443 add_custom_target(uninstall
582   - "${CMAKE_COMMAND}" -P
583   - "${GLFW_BINARY_DIR}/cmake_uninstall.cmake")
  444 + ${CMAKE_COMMAND} -P
  445 + ${GLFW_BINARY_DIR}/cmake_uninstall.cmake)
584 446 endif()
585 447 endif()
586 448  
... ...
app/lib/glfw/README.md
... ... @@ -2,12 +2,13 @@
2 2  
3 3 ## Introduction
4 4  
5   -GLFW is a free, Open Source, multi-platform library for OpenGL and OpenGL ES
  5 +GLFW is a free, Open Source, portable library for OpenGL and OpenGL ES
6 6 application development. It provides a simple, platform-independent API for
7 7 creating windows and contexts, reading input, handling events, etc.
8 8  
9   -Version 3.1.1 adds fixes for a number of bugs that together affect all supported
10   -platforms, most notably workarounds for bugs in some popular window managers.
  9 +Version 3.0.3 adds fixes for a number of bugs that together affect all supported
  10 +platforms, most notably MinGW compilation issues and cursor mode issues on OS X.
  11 +As this is a patch release, there are no API changes.
11 12  
12 13 If you are new to GLFW, you may find the
13 14 [introductory tutorial](http://www.glfw.org/docs/latest/quick.html) for GLFW
... ... @@ -15,74 +16,202 @@ If you are new to GLFW, you may find the
15 16 [transition guide](http://www.glfw.org/docs/latest/moving.html) for moving to
16 17 the GLFW 3 API.
17 18  
18   -Note that a number of source files have been added or renamed in 3.1, which may
19   -require you to update any custom build files you have.
20   -
21 19  
22 20 ## Compiling GLFW
23 21  
24   -See the [Compiling GLFW](http://www.glfw.org/docs/latest/compile.html) guide in
25   -the GLFW documentation.
  22 +### Dependencies
26 23  
  24 +To compile GLFW and the accompanying example programs, you will need **CMake**,
  25 +which will generate the project files or makefiles for your particular
  26 +development environment. If you are on a Unix-like system such as Linux or
  27 +FreeBSD or have a package system like Fink, MacPorts, Cygwin or Homebrew, you
  28 +can simply install its CMake package. If not, you can get installers for
  29 +Windows and OS X from the [CMake website](http://www.cmake.org/).
27 30  
28   -## Using GLFW
  31 +Additional dependencies are listed below.
  32 +
  33 +
  34 +#### Visual C++ on Windows
  35 +
  36 +The Microsoft Platform SDK that is installed along with Visual C++ contains all
  37 +the necessary headers, link libraries and tools except for CMake.
  38 +
  39 +
  40 +#### MinGW or MinGW-w64 on Windows
  41 +
  42 +These packages contain all the necessary headers, link libraries and tools
  43 +except for CMake.
  44 +
  45 +
  46 +#### MinGW or MinGW-w64 cross-compilation
  47 +
  48 +Both Cygwin and many Linux distributions have MinGW or MinGW-w64 packages. For
  49 +example, Cygwin has the `mingw64-i686-gcc` and `mingw64-x86_64-gcc` packages
  50 +for 32- and 64-bit version of MinGW-w64, while Debian GNU/Linux and derivatives
  51 +like Ubuntu have the `mingw-w64` package for both.
  52 +
  53 +GLFW has CMake toolchain files in the `CMake/` directory that allow for easy
  54 +cross-compilation of Windows binaries. To use these files you need to add a
  55 +special parameter when generating the project files or makefiles:
  56 +
  57 + cmake -DCMAKE_TOOLCHAIN_FILE=<toolchain-file> .
  58 +
  59 +The exact toolchain file to use depends on the prefix used by the MinGW or
  60 +MinGW-w64 binaries on your system. You can usually see this in the /usr
  61 +directory. For example, both the Debian/Ubuntu and Cygwin MinGW-w64 packages
  62 +have `/usr/x86_64-w64-mingw32` for the 64-bit compilers, so the correct
  63 +invocation would be:
  64 +
  65 + cmake -DCMAKE_TOOLCHAIN_FILE=CMake/x86_64-w64-mingw32.cmake .
  66 +
  67 +For more details see the article
  68 +[CMake Cross Compiling](http://www.paraview.org/Wiki/CMake_Cross_Compiling) on
  69 +the CMake wiki.
  70 +
  71 +
  72 +#### Xcode on OS X
  73 +
  74 +Xcode contains all necessary tools except for CMake. The necessary headers and