Added config option for PKGCONFIG install location

This commit is contained in:
Alexander Damian
2019-05-15 13:44:07 -04:00
parent 6499ef9869
commit d148fe18d5
4 changed files with 8 additions and 3 deletions

View File

@@ -56,6 +56,10 @@ if (CPPKAFKA_RDKAFKA_STATIC_LIB)
add_definitions("-DLIBRDKAFKA_STATICLIB") add_definitions("-DLIBRDKAFKA_STATICLIB")
endif() endif()
if (NOT CPPKAFKA_PKGCONFIG_DIR)
set(CPPKAFKA_PKGCONFIG_DIR share/pkgconfig)
endif()
# Look for Boost (just need boost.optional headers here) # Look for Boost (just need boost.optional headers here)
find_package(Boost REQUIRED ${FIND_PACKAGE_QUIET}) find_package(Boost REQUIRED ${FIND_PACKAGE_QUIET})
find_package(RdKafka REQUIRED ${FIND_PACKAGE_QUIET}) find_package(RdKafka REQUIRED ${FIND_PACKAGE_QUIET})

View File

@@ -80,6 +80,7 @@ The following cmake options can be specified:
* `CPPKAFKA_BOOST_STATIC_LIBS` : Link with Boost static libraries. Default is `ON`. * `CPPKAFKA_BOOST_STATIC_LIBS` : Link with Boost static libraries. Default is `ON`.
* `CPPKAFKA_BOOST_USE_MULTITHREADED` : Use Boost multi-threaded libraries. Default is `ON`. * `CPPKAFKA_BOOST_USE_MULTITHREADED` : Use Boost multi-threaded libraries. Default is `ON`.
* `CPPKAFKA_RDKAFKA_STATIC_LIB` : Link to Rdkafka static library. Default is `OFF`. * `CPPKAFKA_RDKAFKA_STATIC_LIB` : Link to Rdkafka static library. Default is `OFF`.
* `CPPKAFKA_PKGCONFIG_DIR` : Install location of the .pc file. Default is `share/pkgconfig`.
Example: Example:
```Shell ```Shell

View File

@@ -11,4 +11,4 @@ Version: @CPPKAFKA_VERSION@
Requires: librdkafka >= 0.9.4 Requires: librdkafka >= 0.9.4
Requires.private: Requires.private:
Libs: -L${libdir} -L${sharedlibdir} -L@RDKAFKA_ROOT_DIR@/lib -lcppkafka -lrdkafka -lpthread -lrt -lssl -lcrypto -ldl -lz Libs: -L${libdir} -L${sharedlibdir} -L@RDKAFKA_ROOT_DIR@/lib -lcppkafka -lrdkafka -lpthread -lrt -lssl -lcrypto -ldl -lz
Cflags: -I${includedir} -I${includedir}/cppkafka -I@RDKAFKA_ROOT_DIR@/include -I@Boost_INCLUDE_DIRS@ Cflags: -I${includedir} -I${includedir}/cppkafka -I@RDKAFKA_INCLUDE_DIR@ -I@Boost_INCLUDE_DIRS@

View File

@@ -53,7 +53,7 @@ set(PKG_CONFIG ${PROJECT_SOURCE_DIR}/package/cppkafka.pc)
configure_file(${PROJECT_SOURCE_DIR}/cppkafka.pc.in ${PKG_CONFIG} @ONLY) configure_file(${PROJECT_SOURCE_DIR}/cppkafka.pc.in ${PKG_CONFIG} @ONLY)
install( install(
FILES PKG_CONFIG FILES ${PKG_CONFIG}
DESTINATION share/pkgconfig DESTINATION ${CPPKAFKA_PKGCONFIG_DIR}
COMPONENT pkgconfig COMPONENT pkgconfig
) )