From 7b4268a0aa602ee8a36395075fdb2fb4377f97ae Mon Sep 17 00:00:00 2001 From: Emanuele Sabellico Date: Mon, 6 Feb 2023 13:39:10 +0100 Subject: [PATCH 1/4] Fix CMake pkg-config issue with cURL require --- CHANGELOG.md | 8 ++++++++ src/CMakeLists.txt | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6332265712..d0cfe1abc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# librdkafka v2.0.3 + +librdkafka v2.0.3 is a bugfix release: + +* Fix CMake pkg-config issue with cURL require (#4180). + + + # librdkafka v2.0.2 librdkafka v2.0.2 is a bugfix release: diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 37b43c4996..0e016b1fdc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -296,7 +296,7 @@ if(NOT RDKAFKA_BUILD_STATIC) set(PKG_CONFIG_DESCRIPTION "The Apache Kafka C/C++ library") if(WITH_CURL) - string(APPEND PKG_CONFIG_REQUIRES "curl ") + string(APPEND PKG_CONFIG_REQUIRES "libcurl ") endif() if(WITH_ZLIB) From 441e3ec713e1d4ee127461a7993496b2b4b9aaa6 Mon Sep 17 00:00:00 2001 From: FantasqueX Date: Tue, 11 Apr 2023 23:50:59 +0800 Subject: [PATCH 2/4] Update cmake pkg-config generating (#4165) The name of Curl library is libcurl instead of curl. WITH_SSL also needs libcrypto. Requires.private is more appropriate the Requires. Those changes are referenced from pc file generated by Make. --- packaging/cmake/rdkafka.pc.in | 2 +- src-cpp/CMakeLists.txt | 4 ++-- src/CMakeLists.txt | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packaging/cmake/rdkafka.pc.in b/packaging/cmake/rdkafka.pc.in index 0eb17e8560..9632cf5134 100644 --- a/packaging/cmake/rdkafka.pc.in +++ b/packaging/cmake/rdkafka.pc.in @@ -6,7 +6,7 @@ libdir=${prefix}/lib Name: @PKG_CONFIG_NAME@ Description: @PKG_CONFIG_DESCRIPTION@ Version: @PKG_CONFIG_VERSION@ -Requires: @PKG_CONFIG_REQUIRES@ +Requires.private: @PKG_CONFIG_REQUIRES_PRIVATE@ Cflags: @PKG_CONFIG_CFLAGS@ Libs: @PKG_CONFIG_LIBS@ Libs.private: @PKG_CONFIG_LIBS_PRIVATE@ diff --git a/src-cpp/CMakeLists.txt b/src-cpp/CMakeLists.txt index b0a6d51e47..2b496d9f9e 100644 --- a/src-cpp/CMakeLists.txt +++ b/src-cpp/CMakeLists.txt @@ -41,7 +41,7 @@ set(PKG_CONFIG_VERSION "${PROJECT_VERSION}") if(NOT RDKAFKA_BUILD_STATIC) set(PKG_CONFIG_NAME "librdkafka++") set(PKG_CONFIG_DESCRIPTION "The Apache Kafka C/C++ library") - set(PKG_CONFIG_REQUIRES "rdkafka") + set(PKG_CONFIG_REQUIRES_PRIVATE "rdkafka") set(PKG_CONFIG_CFLAGS "-I\${includedir}") set(PKG_CONFIG_LIBS "-L\${libdir} -lrdkafka++") set(PKG_CONFIG_LIBS_PRIVATE "-lrdkafka") @@ -57,7 +57,7 @@ if(NOT RDKAFKA_BUILD_STATIC) else() set(PKG_CONFIG_NAME "librdkafka++-static") set(PKG_CONFIG_DESCRIPTION "The Apache Kafka C/C++ library (static)") - set(PKG_CONFIG_REQUIRES "") + set(PKG_CONFIG_REQUIRES_PRIVATE "") set(PKG_CONFIG_CFLAGS "-I\${includedir} -DLIBRDKAFKA_STATICLIB") set(PKG_CONFIG_LIBS "-L\${libdir} \${libdir}/librdkafka++.a") if(WIN32) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0e016b1fdc..6e8275dbe0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -272,7 +272,7 @@ endif() # Generate pkg-config file set(PKG_CONFIG_VERSION "${PROJECT_VERSION}") -set(PKG_CONFIG_REQUIRES "") +set(PKG_CONFIG_REQUIRES_PRIVATE "") if (WIN32) set(PKG_CONFIG_LIBS_PRIVATE "-lws2_32 -lsecur32 -lcrypt32") else() @@ -296,27 +296,27 @@ if(NOT RDKAFKA_BUILD_STATIC) set(PKG_CONFIG_DESCRIPTION "The Apache Kafka C/C++ library") if(WITH_CURL) - string(APPEND PKG_CONFIG_REQUIRES "libcurl ") + string(APPEND PKG_CONFIG_REQUIRES_PRIVATE "libcurl ") endif() if(WITH_ZLIB) - string(APPEND PKG_CONFIG_REQUIRES "zlib ") + string(APPEND PKG_CONFIG_REQUIRES_PRIVATE "zlib ") endif() if(WITH_SSL) - string(APPEND PKG_CONFIG_REQUIRES "libssl ") + string(APPEND PKG_CONFIG_REQUIRES_PRIVATE "libcrypto libssl ") endif() if(WITH_SASL_CYRUS) - string(APPEND PKG_CONFIG_REQUIRES "libsasl2 ") + string(APPEND PKG_CONFIG_REQUIRES_PRIVATE "libsasl2 ") endif() if(WITH_ZSTD) - string(APPEND PKG_CONFIG_REQUIRES "libzstd ") + string(APPEND PKG_CONFIG_REQUIRES_PRIVATE "libzstd ") endif() if(WITH_LZ4_EXT) - string(APPEND PKG_CONFIG_REQUIRES "liblz4 ") + string(APPEND PKG_CONFIG_REQUIRES_PRIVATE "liblz4 ") endif() set(PKG_CONFIG_CFLAGS "-I\${includedir}") From 72d920d5ca6db8ec08038cf98f3f55f4b7ff74ee Mon Sep 17 00:00:00 2001 From: Hermann von Kleist Date: Tue, 11 Apr 2023 17:52:11 +0200 Subject: [PATCH 3/4] Include cURL headers not publicly, they are only used in .c files (#4193) --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6e8275dbe0..33481ba1ac 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -199,7 +199,7 @@ target_include_directories(rdkafka PUBLIC "$") if(WITH_CURL) find_package(CURL REQUIRED) - target_include_directories(rdkafka PUBLIC ${CURL_INCLUDE_DIRS}) + target_include_directories(rdkafka PRIVATE ${CURL_INCLUDE_DIRS}) target_link_libraries(rdkafka PUBLIC ${CURL_LIBRARIES}) endif() From e3c891da06b444339f25ca48d4c292cd2d1709f3 Mon Sep 17 00:00:00 2001 From: Emanuele Sabellico Date: Tue, 11 Apr 2023 18:00:09 +0200 Subject: [PATCH 4/4] Update changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 627e3082ff..f6bbcf1e19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ librdkafka v2.1.1 is a maintenance release: -* Fix CMake pkg-config issue with cURL require (#4180). +* Fix CMake pkg-config cURL requires (@FantasqueX, + @stertingen, #4180).