Add used SDL libraries into pkgconfig file

As SDL2pp doesn't replace SDL2 and is designed to be used with plain
SDL2 code, consumers which use SDL2pp with pkgconfig will almost always
be forced to include both SDL2pp and SDL2 includes and libraries. This
seems inconvenient, so add SDL2 libraries to SDL2pp pkgconfig file. This
also improves consistency with the fact that SDL2 includes are
already included in sdl2pp.pc.
This commit is contained in:
Dmitry Marakasov 2015-01-18 20:19:31 +03:00
parent 425b2f835f
commit b20b256d0a
2 changed files with 6 additions and 1 deletions

View File

@ -195,6 +195,11 @@ IF(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
SET(SDL2_PKGCONFIG_CFLAGS "${SDL2_PKGCONFIG_CFLAGS} -I${INCDIR}")
ENDFOREACH(INCDIR IN SDL2_ALL_INCLUDE_DIRS)
SET(SDL2_PKGCONFIG_LIBS "")
FOREACH(LIB IN LISTS SDL2_ALL_LIBRARIES)
SET(SDL2_PKGCONFIG_LIBS "${SDL2_PKGCONFIG_LIBS} ${LIB}")
ENDFOREACH(LIB IN SDL2_LIBRARIES)
CONFIGURE_FILE(
sdl2pp.pc.in
sdl2pp.pc

View File

@ -10,5 +10,5 @@ Description: C++11 bindings/wrappers for SDL2.
Version: @SDL2PP_VERSION@
Requires:
Conflicts:
Libs: -L${libdir} -lSDL2pp
Libs: -L${libdir} -lSDL2pp@SDL2_PKGCONFIG_LIBS@
Cflags: -I${includedir}@SDL2_PKGCONFIG_CFLAGS@