Enabled pkg-config file generation on MinGW.

Fixes #220.
This commit is contained in:
Camilla Berglund 2014-02-10 15:30:51 +01:00
parent cf177905e5
commit 0cd31782d4
2 changed files with 14 additions and 12 deletions

View File

@ -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)

View File

@ -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