Skip to content

Commit d148fe1

Browse files
author
Alexander Damian
committed
Added config option for PKGCONFIG install location
1 parent 6499ef9 commit d148fe1

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ if (CPPKAFKA_RDKAFKA_STATIC_LIB)
5656
add_definitions("-DLIBRDKAFKA_STATICLIB")
5757
endif()
5858

59+
if (NOT CPPKAFKA_PKGCONFIG_DIR)
60+
set(CPPKAFKA_PKGCONFIG_DIR share/pkgconfig)
61+
endif()
62+
5963
# Look for Boost (just need boost.optional headers here)
6064
find_package(Boost REQUIRED ${FIND_PACKAGE_QUIET})
6165
find_package(RdKafka REQUIRED ${FIND_PACKAGE_QUIET})

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ The following cmake options can be specified:
8080
* `CPPKAFKA_BOOST_STATIC_LIBS` : Link with Boost static libraries. Default is `ON`.
8181
* `CPPKAFKA_BOOST_USE_MULTITHREADED` : Use Boost multi-threaded libraries. Default is `ON`.
8282
* `CPPKAFKA_RDKAFKA_STATIC_LIB` : Link to Rdkafka static library. Default is `OFF`.
83+
* `CPPKAFKA_PKGCONFIG_DIR` : Install location of the .pc file. Default is `share/pkgconfig`.
8384

8485
Example:
8586
```Shell

cppkafka.pc.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ Version: @CPPKAFKA_VERSION@
1111
Requires: librdkafka >= 0.9.4
1212
Requires.private:
1313
Libs: -L${libdir} -L${sharedlibdir} -L@RDKAFKA_ROOT_DIR@/lib -lcppkafka -lrdkafka -lpthread -lrt -lssl -lcrypto -ldl -lz
14-
Cflags: -I${includedir} -I${includedir}/cppkafka -I@RDKAFKA_ROOT_DIR@/include -I@Boost_INCLUDE_DIRS@
14+
Cflags: -I${includedir} -I${includedir}/cppkafka -I@RDKAFKA_INCLUDE_DIR@ -I@Boost_INCLUDE_DIRS@

src/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ set(PKG_CONFIG ${PROJECT_SOURCE_DIR}/package/cppkafka.pc)
5353
configure_file(${PROJECT_SOURCE_DIR}/cppkafka.pc.in ${PKG_CONFIG} @ONLY)
5454

5555
install(
56-
FILES PKG_CONFIG
57-
DESTINATION share/pkgconfig
56+
FILES ${PKG_CONFIG}
57+
DESTINATION ${CPPKAFKA_PKGCONFIG_DIR}
5858
COMPONENT pkgconfig
5959
)

0 commit comments

Comments
 (0)