-
Notifications
You must be signed in to change notification settings - Fork 994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] OPENSSL_FOUND and similar variables aren't defined #10829
Comments
I really don't understand this. If I minimize the example (note the use of OpenSSL 3.0):
I get the output:
Looking at that cmake module, it contains:
It seems like it should be set. I can modify that file to output markers. The file is definitely included but in that context EDIT: After looking at some documentation, CMake automatically sets _FOUND but appears to be after the config module has finished running. So unfortunately, this particular use-case seems broken. |
I also found this related issue from a few years back: #3148 Seems that in combination with that and #10387, there's no obvious way to work around this. After delving the source code a bit, I realized there's the concept of "blocks" described in CMakeToolchain. One of those is "find_paths" which apparently controls CMAKE_FIND_PACKAGE_PREFER_CONFIG, but unfortunately doesn't document how. This is what ultimately "fixes" the problem for me:
Since the OpenSSL package generates a FindOpenSSL.cmake module that works (as it explicitly sets OpenSSL_FOUND before the standard variables cmake script is called), this is "good enough". I'm leaving this open because this experience frankly sucked however. |
I found that conan-io/conan-center-index#12838 only fixed this for the 1.x.x recipe versions. I made the similar fix for the 3.x.x recipe versions in conan-io/conan-center-index#14426 |
tc.blocks["find_paths"].values["find_package_prefer_config"]=False works for me !!! |
The PRs above should have taken care of this issue (in the @hchechao2 It is also possible to control the files that I am closing this ticket as solved time ago, please create new tickets if you have any further question, thanks! |
External code often relies on the variable OPENSSL_FOUND being defined. I see code in the OpenSSL package recipe to handle this but I'm a bit confused as to how this is supposed to work. Provided is a test case showing that
OPENSSL_FOUND
is not defined butOpenSSL_FOUND
is defined by default.Environment Details (include every applicable attribute)
Steps to reproduce
Test Case: https://github.com/computerquip-work/conan-openssl-fail-case
From source:
The text was updated successfully, but these errors were encountered: