Export pkg-config dependencies via the CMake cache

This will be useful when building GLFW as a CMake object library and
linking it into a larger library that exports pkg-config information.

Partly based on #1307 by @a3f.

Closes #1307.
This commit is contained in:
Camilla Löwy
2021-07-30 13:19:46 +02:00
parent d83849792b
commit 244948e174
3 changed files with 12 additions and 4 deletions

View File

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