From 4b85e42d278b2cde0f96ec28f281844b63c93a7b Mon Sep 17 00:00:00 2001 From: Adrien Devresse Date: Thu, 6 Dec 2018 14:14:23 +0100 Subject: [PATCH] Add proper pkgconfig support valid both during build phase and after installation --- CMakeLists.txt | 6 ++++++ install/pkgconfig/served.pc.in | 11 +++++++++++ 2 files changed, 17 insertions(+) create mode 100644 install/pkgconfig/served.pc.in diff --git a/CMakeLists.txt b/CMakeLists.txt index b520055..4ca0357 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,6 +95,12 @@ FOREACH (CONFIGINPUT ${CONFIGINPUTS}) CONFIGURE_FILE ("${CONFIGINPUT}" "${CONFIGOUTPUT}") ENDFOREACH (CONFIGINPUT ${CONFIGINPUTS}) +# +# pkg-config file generator +# +CONFIGURE_FILE("install/pkgconfig/served.pc.in" "${LIBRARY_OUTPUT_PATH}/pkgconfig/served.pc" @ONLY) +INSTALL(FILES "${LIBRARY_OUTPUT_PATH}/pkgconfig/served.pc" DESTINATION lib/pkgconfig ) + # # Add Build Targets # diff --git a/install/pkgconfig/served.pc.in b/install/pkgconfig/served.pc.in new file mode 100644 index 0000000..9a35d95 --- /dev/null +++ b/install/pkgconfig/served.pc.in @@ -0,0 +1,11 @@ +prefix=${pcfiledir}/../../ +libdir=${pcfiledir}/../ +includedir=${prefix}/include + +Name: served +Description: @APPLICATION_NAME@ +URL: https://github.com/meltwater/served +Version: @APPLICATION_VERSION_STRING@ +Cflags: -I${includedir} +Libs: -L${libdir} -lserved +