Skip to content

Commit 107cff7

Browse files
author
Alexander Damian
committed
Removed dependency from rdkafka since it has its own pkg_config file. Also added BITNESS detection
1 parent 1a981f2 commit 107cff7

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ 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+
# Determine if this is a 32 or 64 bit build
42+
string(FIND ${CMAKE_CXX_FLAGS} "-m64" BITNESS)
43+
44+
# Properly set the output directory
45+
if (${BITNESS} EQUAL -1)
46+
set(LIBDIR "lib")
47+
else()
48+
set(LIBDIR "lib64")
49+
endif()
50+
4151
# Disable output from find_package macro
4252
if (NOT CPPKAFKA_CMAKE_VERBOSE)
4353
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)