From a459e934984fa7db899ccf43640b26ff9a481c6a Mon Sep 17 00:00:00 2001 From: Michael Heimpold Date: Tue, 4 Sep 2018 01:13:06 +0200 Subject: [PATCH] Install pkg-config files also for non-CMake builds At the moment, pkg-config hint files are only installed when CMake is used as build system. However, it is very convenient for programs using libmosquitto to have these files always in place, so let's add it here, too. Signed-off-by: Michael Heimpold --- lib/Makefile | 3 +++ lib/cpp/Makefile | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Makefile b/lib/Makefile index 9e538195..3a293a8a 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -57,6 +57,9 @@ ifeq ($(WITH_STATIC_LIBRARIES),yes) endif $(INSTALL) -d "${DESTDIR}${prefix}/include/" $(INSTALL) mosquitto.h "${DESTDIR}${prefix}/include/mosquitto.h" + $(INSTALL) -d "${DESTDIR}$(prefix)/lib${LIB_SUFFIX}/pkgconfig" + $(INSTALL) -m644 ../libmosquitto.pc.in "${DESTDIR}$(prefix)/lib${LIB_SUFFIX}/pkgconfig/libmosquitto.pc" + sed -i -e "s#@CMAKE_INSTALL_PREFIX@#$(prefix)#" -e "s#@VERSION@#$(VERSION)#" "${DESTDIR}$(prefix)/lib${LIB_SUFFIX}/pkgconfig/libmosquitto.pc" $(MAKE) -C cpp install uninstall : diff --git a/lib/cpp/Makefile b/lib/cpp/Makefile index a18c3472..a6684757 100644 --- a/lib/cpp/Makefile +++ b/lib/cpp/Makefile @@ -24,7 +24,10 @@ ifeq ($(WITH_STATIC_LIBRARIES),yes) endif $(INSTALL) -d "${DESTDIR}${prefix}/include/" $(INSTALL) mosquittopp.h "${DESTDIR}${prefix}/include/mosquittopp.h" - + $(INSTALL) -d "${DESTDIR}$(prefix)/lib${LIB_SUFFIX}/pkgconfig" + $(INSTALL) -m644 ../../libmosquittopp.pc.in "${DESTDIR}$(prefix)/lib${LIB_SUFFIX}/pkgconfig/libmosquittopp.pc" + sed -i -e "s#@CMAKE_INSTALL_PREFIX@#$(prefix)#" -e "s#@VERSION@#$(VERSION)#" "${DESTDIR}$(prefix)/lib${LIB_SUFFIX}/pkgconfig/libmosquittopp.pc" + uninstall : -rm -f "${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquittopp.so.${SOVERSION}" -rm -f "${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquittopp.so"