From 0cd31782d480f6a81369f09ffeb0f7da7eed4da7 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Mon, 10 Feb 2014 15:30:51 +0100 Subject: [PATCH] Enabled pkg-config file generation on MinGW. Fixes #220. --- CMakeLists.txt | 25 +++++++++++++------------ README.md | 1 + 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 60f23022..d10f10dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -154,6 +154,9 @@ endif() # Use Win32 for window creation #-------------------------------------------------------------------- if (_GLFW_WIN32) + + set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -lgdi32 -lwinmm") + # The DLL links against winmm; the static library loads it # That way, both code paths receive testing if (BUILD_SHARED_LIBS) @@ -180,8 +183,12 @@ endif() # Use WGL for context creation #-------------------------------------------------------------------- if (_GLFW_WGL) + + set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -lopengl32") + list(APPEND glfw_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR}) list(APPEND glfw_LIBRARIES ${OPENGL_gl_LIBRARY}) + endif() #-------------------------------------------------------------------- @@ -308,9 +315,7 @@ if (_GLFW_EGL) list(APPEND glfw_INCLUDE_DIRS ${EGL_INCLUDE_DIR}) list(APPEND glfw_LIBRARIES ${EGL_LIBRARY}) - if (UNIX) - set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} egl") - endif() + set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} egl") if (_GLFW_USE_OPENGL) list(APPEND glfw_LIBRARIES ${OPENGL_gl_LIBRARY}) @@ -397,10 +402,8 @@ 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) - configure_file(${GLFW_SOURCE_DIR}/src/glfw3.pc.in - ${GLFW_BINARY_DIR}/src/glfw3.pc @ONLY) -endif() +configure_file(${GLFW_SOURCE_DIR}/src/glfw3.pc.in + ${GLFW_BINARY_DIR}/src/glfw3.pc @ONLY) #-------------------------------------------------------------------- # Add subdirectories @@ -431,11 +434,9 @@ if (GLFW_INSTALL) ${GLFW_BINARY_DIR}/src/glfwConfigVersion.cmake DESTINATION lib${LIB_SUFFIX}/cmake/glfw) - if (UNIX) - install(EXPORT glfwTargets DESTINATION lib${LIB_SUFFIX}/cmake/glfw) - install(FILES ${GLFW_BINARY_DIR}/src/glfw3.pc - DESTINATION lib${LIB_SUFFIX}/pkgconfig) - endif() + install(EXPORT glfwTargets DESTINATION lib${LIB_SUFFIX}/cmake/glfw) + install(FILES ${GLFW_BINARY_DIR}/src/glfw3.pc + DESTINATION lib${LIB_SUFFIX}/pkgconfig) # Only generate this target if no higher-level project already has if (NOT TARGET uninstall) diff --git a/README.md b/README.md index 37653e0a..df5337cd 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ The following dependencies are needed by the examples and test programs: recorders to fail - [Cocoa] Bugfix: Some Core Foundation objects were leaked during joystick enumeration + - [Win32] Enabled generation of pkg-config file for MinGW - [Win32] Bugfix: Failure to load winmm or its functions was not reported to the error callback - [X11] Bugfix: The case of finding no usable CRTCs was not detected