diff --git a/CMake/glfw3.pc.in b/CMake/glfw3.pc.in index f74298d4..37f4efd9 100644 --- a/CMake/glfw3.pc.in +++ b/CMake/glfw3.pc.in @@ -7,7 +7,7 @@ Name: GLFW Description: A multi-platform library for OpenGL, window and input Version: @GLFW_VERSION@ URL: https://www.glfw.org/ -Requires.private: @GLFW_PKG_DEPS@ +Requires.private: @GLFW_PKG_CONFIG_REQUIRES_PRIVATE@ Libs: -L${libdir} -l@GLFW_LIB_NAME@ -Libs.private: @GLFW_PKG_LIBS@ +Libs.private: @GLFW_PKG_CONFIG_LIBS_PRIVATE@ Cflags: -I${includedir} diff --git a/CMakeLists.txt b/CMakeLists.txt index da12ef73..99fabe8c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -258,12 +258,17 @@ endif() # Export GLFW library dependencies #-------------------------------------------------------------------- foreach(arg ${glfw_PKG_DEPS}) - set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} ${arg}") + set(deps "${deps} ${arg}") endforeach() foreach(arg ${glfw_PKG_LIBS}) - set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} ${arg}") + set(libs "${libs} ${arg}") endforeach() +set(GLFW_PKG_CONFIG_REQUIRES_PRIVATE "${deps}" CACHE INTERNAL + "GLFW pkg-config Requires.private") +set(GLFW_PKG_CONFIG_LIBS_PRIVATE "${libs}" CACHE INTERNAL + "GLFW pkg-config Libs.private") + #-------------------------------------------------------------------- # Create generated files #-------------------------------------------------------------------- diff --git a/README.md b/README.md index 4ef7297b..e5c31593 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,8 @@ information on what to include when reporting a bug. - Added `GLFW_LIBRARY_TYPE` CMake variable for overriding the library type (#279,#1307,#1497,#1574,#1928) - Added `GLFW_EXPORT_PUBLIC_API` CMake option for building an object library that exports - the public API + - Added `GLFW_PKG_CONFIG_REQUIRES_PRIVATE` and `GLFW_PKG_CONFIG_LIBS_PRIVATE` CMake + variables exposing pkg-config dependencies (#1307) - Made joystick subsystem initialize at first use (#1284,#1646) - Made `GLFW_DOUBLEBUFFER` a read-only window attribute - Updated the minimum required CMake version to 3.1 @@ -321,6 +322,7 @@ skills. - Fredrik Ehnbom - Robin Eklind - Siavash Eliasi + - Ahmad Fatoum - Felipe Ferreira - Michael Fogleman - Gerald Franz