Closed PauloCarvalhoRJ closed 1 week ago
Hi @PauloCarvalhoRJ thanks a lot for your question.
In Conan 2 (And new enough Conan 1 versions!) you'll be looking for the self.dependencies
(docs here) accessor
With this, you can query your tested package options like so in a test_package: self.dependencies[self.tested_reference_str].options.minizip
(Or just replace the self.tested_reference_str
for the library name for any other dependency if needed in general recipes)
I hope this helps :)
Hello,
Thank you. The new API is more readable in Conan 2. The error shifted to the cmake.dependencies
side, but I'll start another question for the issue.
best,
PC
Greetings,
So, I have a test package (
test_package
sub-directory in the source repository) inside a package namedzlib/1.2.11
. In zlib's own recipe, I have:I need to access zlib's
self.options.minizip
value in test package's recipe:The code above works with Conan 1, but in Conan 2 I get this error:
Then the question is: How can one now (Conan 2) access options values of library packages in their respective test packages?
Thanks in advance,
PC
Have you read the CONTRIBUTING guide?