Skip to content

Commit c733e0b

Browse files
authored
Merge pull request mfontanini#199 from accelerated/pc_config
Removed dependency from rdkafka since it has its own pkg_config file.…
2 parents 1a981f2 + 07b3c49 commit c733e0b

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ option(CPPKAFKA_BOOST_STATIC_LIBS "Link with Boost static libraries." ON)
3838
option(CPPKAFKA_BOOST_USE_MULTITHREADED "Use Boost multithreaded libraries." ON)
3939
option(CPPKAFKA_RDKAFKA_STATIC_LIB "Link with Rdkafka static library." OFF)
4040

41+
math(EXPR BITS "8*${CMAKE_SIZEOF_VOID_P}")
42+
43+
# Properly set the output directory
44+
if (${BITS} EQUAL 64)
45+
set(LIBDIR "lib64")
46+
else()
47+
set(LIBDIR "lib")
48+
endif()
49+
4150
# Disable output from find_package macro
4251
if (NOT CPPKAFKA_CMAKE_VERBOSE)
4352
set(FIND_PACKAGE_QUIET QUIET)

cppkafka.pc.in

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
prefix=@CMAKE_INSTALL_PREFIX@
22
exec_prefix=${prefix}
3-
libdir=${prefix}/lib
4-
sharedlibdir=${prefix}/lib
3+
libdir=${prefix}/@LIBDIR@
4+
sharedlibdir=${prefix}/@LIBDIR@
55
includedir=${prefix}/include
66

77
Name: cppkafka
88
Url: https://github.com/mfontanini/cppkafka
99
Description: C++ wrapper library on top of RdKafka
1010
Version: @CPPKAFKA_VERSION@
11-
Requires: rdkafka >= 0.9.4 boost
12-
Requires.private:
13-
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_INCLUDE_DIR@ -I@Boost_INCLUDE_DIRS@
11+
Requires:
12+
Requires.private: rdkafka >= 0.9.4, boost
13+
Libs: -L${libdir} -L${sharedlibdir} -lcppkafka
14+
Cflags: -I${includedir} -I${includedir}/cppkafka

src/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ target_include_directories(cppkafka PUBLIC ${PROJECT_SOURCE_DIR}/include)
4343

4444
install(
4545
TARGETS cppkafka
46-
LIBRARY DESTINATION lib
47-
ARCHIVE DESTINATION lib
46+
LIBRARY DESTINATION ${LIBDIR}
47+
ARCHIVE DESTINATION ${LIBDIR}
4848
COMPONENT dev
4949
)
5050

0 commit comments

Comments
 (0)