Repository: conan-io/conan-center-index

Issue:
[package] librdkafka/1.4.0: ConanException: librdkafka/1.4.0 package_info(): Package require 'openssl' not used in components requires
### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **librdkafka/1.4.0**
  * Conan version: **conan 1.29.2**
  * Python version: **Python 3.7.4**

### Steps to reproduce (Include if Applicable)

Build package with librdkafka:ssl=True

Build fails with 
```
ConanException: librdkafka/1.4.0 package_info(): Package require 'openssl' not used in components requires
```

See log below.   

I was able to fix the problem by adding this to `package_info()`:
```
       if self.options.ssl:
            self.cpp_info.components["rdkafka"].requires = ["openssl::openssl"]
```

### Logs (Include/Attach if Applicable)
<details><summary>Click to expand log</summary>

```
$ conan create . librdkafka/1.4.0@ -o librdkafka:ssl=True
Exporting package recipe
librdkafka/1.4.0 exports: File 'conandata.yml' found. Exporting it...
librdkafka/1.4.0 exports: Copied 1 '.yml' file: conandata.yml
librdkafka/1.4.0 exports_sources: Copied 1 '.txt' file: CMakeLists.txt
librdkafka/1.4.0 exports_sources: Copied 4 '.patch' files: 0001-Remove-cmake-module-path-and-change-library-names.patch, 0002-Change-library-targets-and-result-variables-1-3-0.patch, 0002-Change-library-targets-and-result-variables-1-4-0.patch, 0003-Fix-broken-version-1-4-0-on-windows.patch
librdkafka/1.4.0: A new conanfile.py version was exported
librdkafka/1.4.0: Folder: /userhome/epederson/.conan/data/librdkafka/1.4.0/_/_/export
librdkafka/1.4.0: Using the exported files summary hash as the recipe revision: bf9849a78d1ae3b3e83c150adec217f5
librdkafka/1.4.0: Package recipe modified in export, forcing source folder removal
librdkafka/1.4.0: Use the --keep-source, -k option to skip it
librdkafka/1.4.0: Removing the local binary packages from different recipe revisions
librdkafka/1.4.0: Exported revision: bf9849a78d1ae3b3e83c150adec217f5
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Debug
compiler=gcc
compiler.libcxx=libstdc++
compiler.version=5
os=Linux
os_build=Linux
[options]
librdkafka:ssl=True
[build_requires]
[env]

librdkafka/1.4.0: Forced build from source
librdkafka/1.4.0 (test package): Installing package
Requirements
    librdkafka/1.4.0 from 'conan-local-dev' - Cache
    openssl/1.1.1g from 'conan-local-dev' - Cache
Packages
    librdkafka/1.4.0:9228a2947f97211fd1fa81f4d1fe7dc393bcd85d - Build
    openssl/1.1.1g:b1b85bfdc2206d81b3ed6a49e78498182bb98ef3 - Cache

Installing (downloading, building) binaries...
openssl/1.1.1g: Already installed!
librdkafka/1.4.0: Configuring sources in /userhome/epederson/.conan/data/librdkafka/1.4.0/_/_/source
Downloading v1.4.0.tar.gz completed [2659.17k]

librdkafka/1.4.0: Copying sources to build folder
librdkafka/1.4.0: Building your package in /userhome/epederson/.conan/data/librdkafka/1.4.0/_/_/build/9228a2947f97211fd1fa81f4d1fe7dc393bcd85d
librdkafka/1.4.0: Generator cmake created conanbuildinfo.cmake
librdkafka/1.4.0: Generator cmake_find_package created FindOpenSSL.cmake
librdkafka/1.4.0: Calling build()
-- The C compiler identification is GNU 5.3.1
-- The CXX compiler identification is GNU 5.3.1
-- Check for working C compiler: /opt/rh/devtoolset-4/root/usr/bin/cc
-- Check for working C compiler: /opt/rh/devtoolset-4/root/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /opt/rh/devtoolset-4/root/usr/bin/c++
-- Check for working CXX compiler: /opt/rh/devtoolset-4/root/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: called by CMake conan helper
-- Conan: called inside local cache
-- Conan: Adjusting output directories
-- Conan: Using cmake targets configuration
-- Library ssl found /userhome/epederson/.conan/data/openssl/1.1.1g/_/_/package/b1b85bfdc2206d81b3ed6a49e78498182bb98ef3/lib/libssl.a
-- Library crypto found /userhome/epederson/.conan/data/openssl/1.1.1g/_/_/package/b1b85bfdc2206d81b3ed6a49e78498182bb98ef3/lib/libcrypto.a
-- Conan: Adjusting default RPATHs Conan policies
-- Conan: Adjusting language standard
-- Conan: Adjusting fPIC flag (ON)
-- Conan: Compiler GCC>=5, checking major version 5
-- Conan: Checking correct version: 5
-- Conan: C++ stdlib: libstdc++
-- Looking for pow in m
-- Looking for pow in m - found
-- Conan: Using autogenerated FindOpenSSL.cmake
-- Library ssl found /userhome/epederson/.conan/data/openssl/1.1.1g/_/_/package/b1b85bfdc2206d81b3ed6a49e78498182bb98ef3/lib/libssl.a
-- Found: /userhome/epederson/.conan/data/openssl/1.1.1g/_/_/package/b1b85bfdc2206d81b3ed6a49e78498182bb98ef3/lib/libssl.a
-- Library crypto found /userhome/epederson/.conan/data/openssl/1.1.1g/_/_/package/b1b85bfdc2206d81b3ed6a49e78498182bb98ef3/lib/libcrypto.a
-- Found: /userhome/epederson/.conan/data/openssl/1.1.1g/_/_/package/b1b85bfdc2206d81b3ed6a49e78498182bb98ef3/lib/libcrypto.a
-- Library crypto found /userhome/epederson/.conan/data/openssl/1.1.1g/_/_/package/b1b85bfdc2206d81b3ed6a49e78498182bb98ef3/lib/libcrypto.a
-- Found: /userhome/epederson/.conan/data/openssl/1.1.1g/_/_/package/b1b85bfdc2206d81b3ed6a49e78498182bb98ef3/lib/libcrypto.a
-- Library ssl found /userhome/epederson/.conan/data/openssl/1.1.1g/_/_/package/b1b85bfdc2206d81b3ed6a49e78498182bb98ef3/lib/libssl.a
-- Found: /userhome/epederson/.conan/data/openssl/1.1.1g/_/_/package/b1b85bfdc2206d81b3ed6a49e78498182bb98ef3/lib/libssl.a
-- Checking for module 'libsasl2'
--   No package 'libsasl2' found
-- Conan: Using autogenerated FindOpenSSL.cmake
-- Found OpenSSL: 1.1.1g (found version "1.1.1g")
-- Library ssl found /userhome/epederson/.conan/data/openssl/1.1.1g/_/_/package/b1b85bfdc2206d81b3ed6a49e78498182bb98ef3/lib/libssl.a
-- Skipping already existing target: CONAN_LIB::OpenSSL_ssl
-- Found: /userhome/epederson/.conan/data/openssl/1.1.1g/_/_/package/b1b85bfdc2206d81b3ed6a49e78498182bb98ef3/lib/libssl.a
-- Library crypto found /userhome/epederson/.conan/data/openssl/1.1.1g/_/_/package/b1b85bfdc2206d81b3ed6a49e78498182bb98ef3/lib/libcrypto.a
-- Skipping already existing target: CONAN_LIB::OpenSSL_crypto
-- Found: /userhome/epederson/.conan/data/openssl/1.1.1g/_/_/package/b1b85bfdc2206d81b3ed6a49e78498182bb98ef3/lib/libcrypto.a
-- Library crypto found /userhome/epederson/.conan/data/openssl/1.1.1g/_/_/package/b1b85bfdc2206d81b3ed6a49e78498182bb98ef3/lib/libcrypto.a
-- Skipping already existing target: CONAN_LIB::OpenSSL_Crypto_crypto
-- Found: /userhome/epederson/.conan/data/openssl/1.1.1g/_/_/package/b1b85bfdc2206d81b3ed6a49e78498182bb98ef3/lib/libcrypto.a
-- Library ssl found /userhome/epederson/.conan/data/openssl/1.1.1g/_/_/package/b1b85bfdc2206d81b3ed6a49e78498182bb98ef3/lib/libssl.a
-- Skipping already existing target: CONAN_LIB::OpenSSL_SSL_ssl
-- Found: /userhome/epederson/.conan/data/openssl/1.1.1g/_/_/package/b1b85bfdc2206d81b3ed6a49e78498182bb98ef3/lib/libssl.a
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_EXPORT_NO_PACKAGE_REGISTRY


-- Build files have been written to: /userhome/epederson/.conan/data/librdkafka/1.4.0/_/_/build/9228a2947f97211fd1fa81f4d1fe7dc393bcd85d
Scanning dependencies of target rdkafka
[  2%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/crc32c.c.o
[  3%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdaddr.c.o
[  7%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdavl.c.o
[ 12%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdcrc32.c.o
[ 17%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdbuf.c.o
[ 17%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka.c.o
[ 20%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_broker.c.o
[ 20%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_buf.c.o
[ 20%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdfnv1a.c.o
[ 20%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_cgrp.c.o
[ 20%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_event.c.o
[ 20%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_conf.c.o
[ 20%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_feature.c.o
[ 20%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_assignor.c.o
[ 20%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_lz4.c.o
[ 20%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_metadata.c.o
[ 21%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_metadata_cache.c.o
[ 22%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_msg.c.o
[ 23%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_msgset_reader.c.o
[ 25%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_msgset_writer.c.o
[ 26%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_offset.c.o
[ 27%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_op.c.o
[ 30%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_pattern.c.o
[ 31%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_queue.c.o
[ 31%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_partition.c.o
[ 32%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_range_assignor.c.o
[ 33%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_request.c.o
[ 35%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_roundrobin_assignor.c.o
[ 36%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_sasl.c.o
[ 37%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_sasl_plain.c.o
[ 38%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_subscription.c.o
[ 40%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_timer.c.o
[ 41%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_topic.c.o
[ 42%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_transport.c.o
[ 43%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_interceptor.c.o
[ 47%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_header.c.o
[ 47%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_admin.c.o
[ 47%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_aux.c.o
[ 48%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_background.c.o
[ 50%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_idempotence.c.o
[ 51%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_txnmgr.c.o
[ 52%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_cert.c.o
[ 53%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_coord.c.o
[ 55%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_mock.c.o
[ 56%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_mock_handlers.c.o
[ 57%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_mock_cgrp.c.o
[ 58%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_error.c.o
[ 62%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdmurmur2.c.o
[ 62%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdlist.c.o
[ 62%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdlog.c.o
[ 65%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdports.c.o
[ 65%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdrand.c.o
[ 66%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdregex.c.o
[ 68%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdstring.c.o
[ 68%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdunittest.c.o
[ 72%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/snappy.c.o
[ 72%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdvarint.c.o
[ 72%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/tinycthread.c.o
[ 75%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/tinycthread_extra.c.o
[ 75%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdxxhash.c.o
[ 76%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdkafka_ssl.c.o
[ 77%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rdhdrhistogram.c.o
[ 78%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/rddl.c.o
[ 82%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/lz4frame.c.o
[ 82%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/lz4.c.o
[ 82%] Building C object source_subfolder/src/CMakeFiles/rdkafka.dir/lz4hc.c.o
[ 83%] Linking C static library ../../lib/librdkafka.a
[ 83%] Built target rdkafka
Scanning dependencies of target rdkafka++
[ 91%] Building CXX object source_subfolder/src-cpp/CMakeFiles/rdkafka++.dir/ConfImpl.cpp.o
[ 95%] Building CXX object source_subfolder/src-cpp/CMakeFiles/rdkafka++.dir/HandleImpl.cpp.o
[ 98%] Building CXX object source_subfolder/src-cpp/CMakeFiles/rdkafka++.dir/HeadersImpl.cpp.o
[ 98%] Building CXX object source_subfolder/src-cpp/CMakeFiles/rdkafka++.dir/KafkaConsumerImpl.cpp.o
[ 98%] Building CXX object source_subfolder/src-cpp/CMakeFiles/rdkafka++.dir/MessageImpl.cpp.o
[ 98%] Building CXX object source_subfolder/src-cpp/CMakeFiles/rdkafka++.dir/ConsumerImpl.cpp.o
[ 98%] Building CXX object source_subfolder/src-cpp/CMakeFiles/rdkafka++.dir/TopicPartitionImpl.cpp.o
[ 98%] Building CXX object source_subfolder/src-cpp/CMakeFiles/rdkafka++.dir/MetadataImpl.cpp.o
[ 98%] Building CXX object source_subfolder/src-cpp/CMakeFiles/rdkafka++.dir/ProducerImpl.cpp.o
[ 98%] Building CXX object source_subfolder/src-cpp/CMakeFiles/rdkafka++.dir/QueueImpl.cpp.o
[ 98%] Building CXX object source_subfolder/src-cpp/CMakeFiles/rdkafka++.dir/RdKafka.cpp.o
[ 98%] Building CXX object source_subfolder/src-cpp/CMakeFiles/rdkafka++.dir/TopicImpl.cpp.o
[100%] Linking CXX static library ../../lib/librdkafka++.a
[100%] Built target rdkafka++
librdkafka/1.4.0: Package '9228a2947f97211fd1fa81f4d1fe7dc393bcd85d' built
librdkafka/1.4.0: Build folder /userhome/epederson/.conan/data/librdkafka/1.4.0/_/_/build/9228a2947f97211fd1fa81f4d1fe7dc393bcd85d
librdkafka/1.4.0: Generated conaninfo.txt
librdkafka/1.4.0: Generated conanbuildinfo.txt
librdkafka/1.4.0: Generating the package
librdkafka/1.4.0: Package folder /userhome/epederson/.conan/data/librdkafka/1.4.0/_/_/package/9228a2947f97211fd1fa81f4d1fe7dc393bcd85d
librdkafka/1.4.0: Calling package()
[ 83%] Built target rdkafka
[100%] Built target rdkafka++
Install the project...
-- Install configuration: "Debug"
-- Installing: /userhome/epederson/.conan/data/librdkafka/1.4.0/_/_/package/9228a2947f97211fd1fa81f4d1fe7dc393bcd85d/lib/cmake/RdKafka/RdKafkaConfig.cmake
-- Installing: /userhome/epederson/.conan/data/librdkafka/1.4.0/_/_/package/9228a2947f97211fd1fa81f4d1fe7dc393bcd85d/lib/cmake/RdKafka/RdKafkaConfigVersion.cmake
-- Installing: /userhome/epederson/.conan/data/librdkafka/1.4.0/_/_/package/9228a2947f97211fd1fa81f4d1fe7dc393bcd85d/lib/cmake/RdKafka/FindLZ4.cmake
-- Installing: /userhome/epederson/.conan/data/librdkafka/1.4.0/_/_/package/9228a2947f97211fd1fa81f4d1fe7dc393bcd85d/lib/cmake/RdKafka/RdKafkaTargets.cmake
-- Installing: /userhome/epederson/.conan/data/librdkafka/1.4.0/_/_/package/9228a2947f97211fd1fa81f4d1fe7dc393bcd85d/lib/cmake/RdKafka/RdKafkaTargets-debug.cmake
-- Installing: /userhome/epederson/.conan/data/librdkafka/1.4.0/_/_/package/9228a2947f97211fd1fa81f4d1fe7dc393bcd85d/share/licenses/librdkafka/LICENSES.txt
-- Installing: /userhome/epederson/.conan/data/librdkafka/1.4.0/_/_/package/9228a2947f97211fd1fa81f4d1fe7dc393bcd85d/lib/pkgconfig/rdkafka.pc
-- Up-to-date: /userhome/epederson/.conan/data/librdkafka/1.4.0/_/_/package/9228a2947f97211fd1fa81f4d1fe7dc393bcd85d/lib/pkgconfig/rdkafka.pc
-- Installing: /userhome/epederson/.conan/data/librdkafka/1.4.0/_/_/package/9228a2947f97211fd1fa81f4d1fe7dc393bcd85d/lib/librdkafka.a
-- Installing: /userhome/epederson/.conan/data/librdkafka/1.4.0/_/_/package/9228a2947f97211fd1fa81f4d1fe7dc393bcd85d/include/librdkafka/rdkafka.h
-- Installing: /userhome/epederson/.conan/data/librdkafka/1.4.0/_/_/package/9228a2947f97211fd1fa81f4d1fe7dc393bcd85d/include/librdkafka/rdkafka_mock.h
-- Installing: /userhome/epederson/.conan/data/librdkafka/1.4.0/_/_/package/9228a2947f97211fd1fa81f4d1fe7dc393bcd85d/lib/pkgconfig/rdkafka++.pc
-- Up-to-date: /userhome/epederson/.conan/data/librdkafka/1.4.0/_/_/package/9228a2947f97211fd1fa81f4d1fe7dc393bcd85d/lib/pkgconfig/rdkafka.pc
-- Installing: /userhome/epederson/.conan/data/librdkafka/1.4.0/_/_/package/9228a2947f97211fd1fa81f4d1fe7dc393bcd85d/lib/librdkafka++.a
-- Installing: /userhome/epederson/.conan/data/librdkafka/1.4.0/_/_/package/9228a2947f97211fd1fa81f4d1fe7dc393bcd85d/include/librdkafka/rdkafkacpp.h
librdkafka/1.4.0 package(): Packaged 1 '.txt' file: LICENSES.txt
librdkafka/1.4.0 package(): Packaged 2 '.a' files: librdkafka.a, librdkafka++.a
librdkafka/1.4.0 package(): Packaged 3 '.h' files: rdkafka.h, rdkafka_mock.h, rdkafkacpp.h
librdkafka/1.4.0: Package '9228a2947f97211fd1fa81f4d1fe7dc393bcd85d' created
librdkafka/1.4.0: Created package revision 2a2a217da9b1709cd0ca6b76cc457212
ERROR:
        ConanException: librdkafka/1.4.0 package_info(): Package require 'openssl' not used in components requires

```

</details>



Discussion:

Resolving patch:
diff --git a/recipes/librdkafka/all/conanfile.py b/recipes/librdkafka/all/conanfile.py
--- a/recipes/librdkafka/all/conanfile.py
+++ b/recipes/librdkafka/all/conanfile.py
@@ -73,19 +73,13 @@ def _configure_cmake(self):
         if self._cmake is not None:
             return self._cmake
         self._cmake = CMake(self)
-        self._cmake.definitions["WITHOUT_OPTIMIZATION"] = (
-            self.settings.build_type == "Debug"
-        )
+        self._cmake.definitions["WITHOUT_OPTIMIZATION"] = self.settings.build_type == "Debug"
         self._cmake.definitions["ENABLE_DEVEL"] = self.settings.build_type == "Debug"
-        self._cmake.definitions["ENABLE_REFCNT_DEBUG"] = (
-            self.settings.build_type == "Debug"
-        )
         self._cmake.definitions["RDKAFKA_BUILD_STATIC"] = not self.options.shared
         self._cmake.definitions["RDKAFKA_BUILD_EXAMPLES"] = False
         self._cmake.definitions["RDKAFKA_BUILD_TESTS"] = False
         self._cmake.definitions["WITHOUT_WIN32_CONFIG"] = True
         self._cmake.definitions["WITH_BUNDLED_SSL"] = False
-
         self._cmake.definitions["WITH_ZLIB"] = self.options.zlib
         self._cmake.definitions["WITH_ZSTD"] = self.options.zstd
         self._cmake.definitions["WITH_PLUGINS"] = self.options.plugins
@@ -117,8 +111,20 @@ def package_info(self):
         self.cpp_info.components["rdkafka"].names["cmake_find_package_multi"] = "rdkafka"
         self.cpp_info.components["rdkafka"].names["pkg_config"] = "rdkafka"
         self.cpp_info.components["rdkafka"].libs = ["rdkafka"]
-        if self.settings.compiler == "Visual Studio":
-            self.cpp_info.components["rdkafka"].system_libs.extend(["crypt32", "ws2_32"])
+        if self.options.zlib:
+            self.cpp_info.components["rdkafka"].requires.append("zlib::zlib")
+        if self.options.zstd:
+            self.cpp_info.components["rdkafka"].requires.append("zstd::zstd")
+        if self.options.ssl:
+            self.cpp_info.components["rdkafka"].requires.append("openssl::openssl")
+        if self.options.sasl and self.settings.os != "Windows":
+            self.cpp_info.components["rdkafka"].requires.append("cyrus-sasl::cyrus-sasl")
+        if self.options.lz4:
+            self.cpp_info.components["rdkafka"].requires.append("lz4::lz4")
+        if self.settings.os == "Windows":
+            self.cpp_info.components["rdkafka"].system_libs = ["ws2_32", "secur32"]
+            if self.options.ssl:
+                self.cpp_info.components["rdkafka"].system_libs.append("crypt32")
         elif self.settings.os == "Linux":
             self.cpp_info.components["rdkafka"].system_libs.extend(["pthread", "rt", "dl", "m"])
         if not self.options.shared:


Test patch: