Comments (7)
I'm not sure if this is an issue here or in https://github.com/conan-io/cmake-conan, happy to create another one over there.
from cmake-conan.
Hi @pschichtel,
Thanks for the question. I think that the problem could be that you need to add the CMakeDeps
generator to your conanfile.py and also expand the settings to include at least the build_type
. If you check your logs there should be a warning emitted by cmake-conan saying something like: Cmake-conan: CMakeDeps generator was not defined in the conanfile
Please try with something like this:
from conan import ConanFile
class LibDataChannel(ConanFile):
settings = "os", "arch", "compiler", "build_type"
requires = "openssl/3.2.2"
generators = "CMakeDeps"
def configure(self):
# self.options["openssl"].shared = self.settings.os != "Windows"
self.options["openssl"].shared = True
Hope this helps.
from cmake-conan.
thanks @czoido, this version indeed works:
from conan import ConanFile
class LibDataChannel(ConanFile):
settings = "os", "arch", "compiler", "build_type"
requires = "openssl/3.2.2"
generators = "CMakeDeps"
def configure(self):
self.options["openssl"].shared = self.settings.os != "Windows"
I still wonder: why do I need the generator explicitly in the python version, when I don't need it in the text version?
from cmake-conan.
I still wonder: why do I need the generator explicitly in the python version, when I don't need it in the text version?
That's related to these lines of cmake-conan, it behaves a bit different when you use a conanfile.txt or conanfile.py, but the warning is always there. Check here:
cmake-conan/conan_provider.cmake
Lines 572 to 585 in 8bf396b
I think that's to prevent fails and try not to break users from cmake-conan 1.x in the simple conanfile.txt version and as said in the comments in the code it will be mandatory in the near future to have the generator in the conanfile. I'll check with the team if we need to introduce a more visible warning there or something.
Anyway, I'm glad that it finally worked. I'll keep the issue open until we decide if we have to make something in the cmake-conan side. Thanks a lot!
from cmake-conan.
Ah this makes sense. I was actually not aware I have warnings, I guess it gets drowned by all the log output from the actual compilation.
I could imagine having some form of "strict mode" that just outright fails things like this.
from cmake-conan.
Hi @pschichtel,
Thanks for the feedback, I'm transferring this to the cmake-conan repo to check if we want to handle the issue there in some way.
from cmake-conan.
Thanks for the feedback. This tool will remove the automatic injection of CMakeDeps
and require conanfiles to explicitly define it, the warning is preventing users to start defining it explicitly to avoid future failure.
from cmake-conan.
Related Issues (20)
- Unable to cross compile openssl/3.x.x on develop2 HOT 6
- Using "build-scripts" package via tool_requires() not working HOT 5
- [develop2] CMAKE_CONFIGURATION_TYPES with custom build types not getting dependencies added properly HOT 3
- ERROR: Invalid setting '6' is not a valid 'settings.compiler.version' value HOT 2
- 【conan install】conan_provider.cmake downloads packages from source because detect_host_profile generates compiler.cppstd=xx in the cmake-build-release/conan_host_profile file with the detect_host_profile method HOT 5
- cmake bootstrapping fails if not on PATH HOT 3
- Not working with conan editable mode HOT 5
- Update readme with more details HOT 1
- MSVC version update HOT 6
- [question] Using layout and -of together Conan 2 HOT 4
- Some "url" attributes causes cmake-conan to fail HOT 3
- MSVC unknown compiler version 1940 HOT 23
- fail to set XXX_INCLUDE_DIR HOT 1
- [bug] passing path with ""(double quotes) to conan_install() HOT 3
- conan_provider.cmake and conan options? HOT 1
- How can a toolchain be downloaded and used to build other dependencies of CMAKE project. HOT 1
- [develop2]How to enable build_type switch after cmake executed with Multi Configuration generators like Visual Studio? HOT 2
- [develop2] Offline behaviour is suboptimal HOT 2
- [question] How to propagate options from cmake using conan_provider? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cmake-conan.