mirror of https://git.wownero.com/dsc/mxe.git
add package glfw3
This commit is contained in:
parent
9c97a39322
commit
026521cef1
|
@ -1347,7 +1347,11 @@ local-pkg-list: $(LOCAL_PKG_LIST)</pre>
|
|||
</tr>
|
||||
<tr>
|
||||
<td class="package">glfw2</td>
|
||||
<td class="website"><a href="http://www.glfw.org/">GLEW</a></td>
|
||||
<td class="website"><a href="http://www.glfw.org/">GLFW 2.x</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="package">glfw3</td>
|
||||
<td class="website"><a href="http://www.glfw.org/">GLFW 3.x</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="package">glib</td>
|
||||
|
|
|
@ -24,6 +24,6 @@ define $(PKG)_BUILD
|
|||
#Test
|
||||
'$(TARGET)-gcc' \
|
||||
-W -Wall -Werror -ansi -pedantic \
|
||||
'$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-glfw.exe' \
|
||||
'$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-glfw2.exe' \
|
||||
`'$(TARGET)-pkg-config' libglfw --cflags --libs`
|
||||
endef
|
||||
|
|
|
@ -0,0 +1,108 @@
|
|||
This file is part of MXE.
|
||||
See index.html for further information.
|
||||
|
||||
Contains ad hoc patches for cross building.
|
||||
|
||||
From 7106d77856268c39b08de8cbe6f526fda8506389 Mon Sep 17 00:00:00 2001
|
||||
From: MXE
|
||||
Date: Sun, 10 Nov 2013 16:23:03 +1100
|
||||
Subject: [PATCH] add option to install pkg-config file
|
||||
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 7c9b2c2..cd0112c 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -14,6 +14,7 @@ option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
|
||||
option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" ON)
|
||||
option(GLFW_BUILD_TESTS "Build the GLFW test programs" ON)
|
||||
option(GLFW_INSTALL "Generate installation target" ON)
|
||||
+option(GLFW_INSTALL_PKG_CONFIG "Install pkg-config file" OFF)
|
||||
option(GLFW_DOCUMENT_INTERNALS "Include internals in documentation" OFF)
|
||||
|
||||
if (WIN32)
|
||||
@@ -117,7 +118,7 @@ endif()
|
||||
#--------------------------------------------------------------------
|
||||
if (WIN32)
|
||||
set(_GLFW_WIN32 1)
|
||||
- message(STATUS "Using Win32 for window creation")
|
||||
+ message(STATUS "Using Win32 for window creation")
|
||||
|
||||
if (GLFW_USE_EGL)
|
||||
set(_GLFW_EGL 1)
|
||||
@@ -133,7 +134,7 @@ elseif (APPLE)
|
||||
message(STATUS "Using NSGL for context creation")
|
||||
elseif (UNIX)
|
||||
set(_GLFW_X11 1)
|
||||
- message(STATUS "Using X11 for window creation")
|
||||
+ message(STATUS "Using X11 for window creation")
|
||||
|
||||
if (GLFW_USE_EGL)
|
||||
set(_GLFW_EGL 1)
|
||||
@@ -238,7 +239,7 @@ if (_GLFW_X11)
|
||||
# Check for Xkb (X keyboard extension)
|
||||
if (NOT X11_Xkb_FOUND)
|
||||
message(FATAL_ERROR "The X keyboard extension headers were not found")
|
||||
- endif()
|
||||
+ endif()
|
||||
|
||||
list(APPEND glfw_INCLUDE_DIR ${X11_Xkb_INCLUDE_PATH})
|
||||
|
||||
@@ -336,7 +337,7 @@ endif()
|
||||
# Use Cocoa for window creation and NSOpenGL for context creation
|
||||
#--------------------------------------------------------------------
|
||||
if (_GLFW_COCOA AND _GLFW_NSGL)
|
||||
-
|
||||
+
|
||||
if (GLFW_USE_MENUBAR)
|
||||
set(_GLFW_USE_MENUBAR 1)
|
||||
endif()
|
||||
@@ -351,7 +352,7 @@ if (_GLFW_COCOA AND _GLFW_NSGL)
|
||||
else()
|
||||
message(STATUS "Building GLFW only for the native architecture")
|
||||
endif()
|
||||
-
|
||||
+
|
||||
# Set up library and include paths
|
||||
find_library(COCOA_FRAMEWORK Cocoa)
|
||||
find_library(IOKIT_FRAMEWORK IOKit)
|
||||
@@ -386,7 +387,7 @@ endif()
|
||||
configure_file(${GLFW_SOURCE_DIR}/docs/Doxyfile.in
|
||||
${GLFW_BINARY_DIR}/docs/Doxyfile @ONLY)
|
||||
|
||||
-configure_file(${GLFW_SOURCE_DIR}/src/config.h.in
|
||||
+configure_file(${GLFW_SOURCE_DIR}/src/config.h.in
|
||||
${GLFW_BINARY_DIR}/src/config.h @ONLY)
|
||||
|
||||
configure_file(${GLFW_SOURCE_DIR}/src/glfwConfig.cmake.in
|
||||
@@ -395,7 +396,7 @@ configure_file(${GLFW_SOURCE_DIR}/src/glfwConfig.cmake.in
|
||||
configure_file(${GLFW_SOURCE_DIR}/src/glfwConfigVersion.cmake.in
|
||||
${GLFW_BINARY_DIR}/src/glfwConfigVersion.cmake @ONLY)
|
||||
|
||||
-if (UNIX)
|
||||
+if (UNIX OR GLFW_INSTALL_PKG_CONFIG)
|
||||
configure_file(${GLFW_SOURCE_DIR}/src/glfw3.pc.in
|
||||
${GLFW_BINARY_DIR}/src/glfw3.pc @ONLY)
|
||||
endif()
|
||||
@@ -422,7 +423,7 @@ endif()
|
||||
# The library is installed by src/CMakeLists.txt
|
||||
#--------------------------------------------------------------------
|
||||
if (GLFW_INSTALL)
|
||||
- install(DIRECTORY include/GLFW DESTINATION include
|
||||
+ install(DIRECTORY include/GLFW DESTINATION include
|
||||
FILES_MATCHING PATTERN glfw3.h PATTERN glfw3native.h)
|
||||
|
||||
install(FILES ${GLFW_BINARY_DIR}/src/glfwConfig.cmake
|
||||
@@ -431,6 +432,9 @@ if (GLFW_INSTALL)
|
||||
|
||||
if (UNIX)
|
||||
install(EXPORT glfwTargets DESTINATION lib${LIB_SUFFIX}/cmake/glfw)
|
||||
+ endif()
|
||||
+
|
||||
+ if (UNIX OR GLFW_INSTALL_PKG_CONFIG)
|
||||
install(FILES ${GLFW_BINARY_DIR}/src/glfw3.pc
|
||||
DESTINATION lib${LIB_SUFFIX}/pkgconfig)
|
||||
endif()
|
||||
--
|
||||
1.8.4
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* This file is part of MXE.
|
||||
* See index.html for further information.
|
||||
*/
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
GLFWwindow* window;
|
||||
|
||||
/* Initialize the library */
|
||||
if (!glfwInit())
|
||||
return -1;
|
||||
|
||||
/* Create a windowed mode window and its OpenGL context */
|
||||
window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL);
|
||||
if (!window)
|
||||
{
|
||||
glfwTerminate();
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Make the window's context current */
|
||||
glfwMakeContextCurrent(window);
|
||||
|
||||
/* Loop until the user closes the window */
|
||||
while (!glfwWindowShouldClose(window))
|
||||
{
|
||||
/* Render here */
|
||||
|
||||
/* Swap front and back buffers */
|
||||
glfwSwapBuffers(window);
|
||||
|
||||
/* Poll for and process events */
|
||||
glfwPollEvents();
|
||||
}
|
||||
|
||||
glfwTerminate();
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
# This file is part of MXE.
|
||||
# See index.html for further information.
|
||||
|
||||
PKG := glfw3
|
||||
$(PKG)_IGNORE :=
|
||||
$(PKG)_VERSION := 3.0.3
|
||||
$(PKG)_CHECKSUM := 95d0d2a250dc4e9d612cdd1a7433de464db16d89
|
||||
$(PKG)_SUBDIR := glfw-$($(PKG)_VERSION)
|
||||
$(PKG)_FILE := glfw-$($(PKG)_VERSION).tar.gz
|
||||
$(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/glfw/glfw/$($(PKG)_VERSION)/$($(PKG)_FILE)
|
||||
$(PKG)_DEPS := gcc
|
||||
|
||||
define $(PKG)_UPDATE
|
||||
$(WGET) -q -O- 'http://sourceforge.net/projects/glfw/files/glfw/' | \
|
||||
$(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \
|
||||
grep '^3\.' | \
|
||||
$(SORT) -V | \
|
||||
tail -1
|
||||
endef
|
||||
|
||||
define $(PKG)_BUILD
|
||||
mkdir '$(1).build'
|
||||
cd '$(1).build' && cmake '$(1)' \
|
||||
-DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \
|
||||
-DGLFW_BUILD_EXAMPLES=FALSE \
|
||||
-DGLFW_BUILD_TESTS=FALSE \
|
||||
-DGLFW_INSTALL_PKG_CONFIG=TRUE \
|
||||
-DGLFW_PKG_LIBS='-lopengl32 -lgdi32'
|
||||
$(MAKE) -C '$(1).build' -j '$(JOBS)' install
|
||||
|
||||
'$(TARGET)-gcc' \
|
||||
-W -Wall -Werror -ansi -pedantic \
|
||||
'$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-glfw3.exe' \
|
||||
`'$(TARGET)-pkg-config' glfw3 --cflags --libs`
|
||||
endef
|
Loading…
Reference in New Issue