I'm writing recipe for creating package for rabbitmq-c library. When ENABLE_SSL_SUPPORT option in its CMake script is checked it requires OpenSSL library for its build.
As it shown on provided screen paths to Debug and Release versions of libeay.lib and ssleay.lib files are required.
In my conanfile.py
for rabbitmq-c
library I have the following code which describes the dependency.
def requirements(self):
if self.options.ssl_support:
self.requires("OpenSSL/1.0.2l@bobeff/stable")
How to get right values from required OpenSSL package to set them in CMake configure options for RabbitMQ-C recipe?
The package OpenSSL/1.0.2l@bobeff/stable
can be build with different settings and options. How to choose which to be used when I'm building RabbitMQ-C? For example how to choose whether static or dynamic version of OpenSSL to be used for linking with RabbitMQ-C dll files?
You have full access to the dependencies model inside your
build()
method, so you can access:Also if you want to access the aggregated values (for all the dependencies/requirements), you can do:
So, given those values, you can pass them to your build system, in the case of CMake you could do something like:
That will be translated to a cmake command including the
-DSSL_INCLUDE_PATH=<path to openssl include>
flag.If you go for multi-configuration packages, you can check (http://docs.conan.io/en/latest/packaging/package_info.html#multi-configuration-packages). They will define
debug, release
configs, that you can also later use in your model: