Comments (11)
Hey @memsharded ,
You can close it
from cmake-conan.
No, right now it is not implemented. The current solution is to provide your own conanfile and use it from your call, instead of specifying requires and other things as options in the cmake code.
conan_cmake_run(CONANFILE conanfile.txt # or relative build/conanfile.txt
BASIC_SETUP CMAKE_TARGETS)
I suggest trying this, would it be a solution for you? Thanks!
from cmake-conan.
Does the txt format support build_requirements?
I suggest trying this, would it be a solution for you? Thanks!
It is exactly what i'm doing now. It is possible to use a cmake config template to create a py or txt conanfile, but it would be nice if it is integrated.
Generally i would prefer conanfile.py, but when i have many cmake variables to turn on/off features, i'm not sure how i can provide a good conanfile.py, because of the parameter handling. The project also has an integrated conanfile.py for exporting things.
from cmake-conan.
Yes, txt format uses [build_requires]
, you can use it too (and conanfile.py too).
Regarding the conanfile.py and the on/off variables, not sure, I'd need to have a look to it to make an idea.
Also, adding a BUILD_REQUIRES section to conan_cmake_run should be quite straightforward, so maybe that would be better for you. Would you like to contribute it? Thanks!
from cmake-conan.
Regarding the conanfile.py and the on/off variables, not sure, I'd need to have a look to it to make an idea.
Ok
Also, adding a BUILD_REQUIRES section to conan_cmake_run should be quite straightforward, so maybe > that would be better for you. Would you like to contribute it? Thanks!
Yes, i will create a PR if i'm ready
from cmake-conan.
Yes, txt format uses [build_requires], you can use it too (and conanfile.py too).
Are you sure. I'm using 1.0.3 and i'm getting the follwoing error when i add this to txt
ConfigParser: Unrecognized field 'build_requires'
from cmake-conan.
Hi! We've been thinking about this after your PR and we realized that requirements and build_requirements have no difference in a conanfile.txt because the meaning of a build_require is requiring something for building, but with a conanfile.txt there is no build method, right? You could use a virtualenv generator but a regular require will apply exactly the same.
What is exactly your use case? The implementation looks easy but maybe we are not applying correctly the build_requires, so will require some tests.
from cmake-conan.
Hey @lasote , you are right. I see the requires variable has a access qualifier. I want to add my gtest dependency as private, so maybe that's my real solution.
Is it possible to define the access qualifier in the conanfile.txt format?
from cmake-conan.
No, it is not possible to use "private" qualifier in conanfile.txt. Do you have any version conflict upstream that forces you to do so? Because that is the main use case of "private" dependencies. As most likely usptream gtest is being used as "build_requires", there is no need to use "private" dependency for gtest in your conanfile.txt. Is there any other reason I am missing? Thanks!
from cmake-conan.
I think i will use a conanfile.py and run it via cmake-conan. With that i have fine control over the requirements.
Sometimes it happens the some project use a different gtest version and that's not so good, thats my main reason.
from cmake-conan.
Hi @tonka3000
Sorry for the above, that is true, conanfile.txt
doesn't have [build_requires]
, I made a mistake, that is from profiles.
Yes, I think if you want to have fine control, the best is to use a conanfile.py and use it from cmake-conan. Still transparent for cmake users, but you have better control.
Can this issue be closed now then? Thanks!
from cmake-conan.
Related Issues (20)
- Installing only certain packages HOT 8
- [develop2] Question: How stable is the current state HOT 2
- tools.build:compiler_executables breaks build with Autotools and Xcode HOT 3
- [develop2] detect_compiler() detects invalid 'settings.compiler.version' for apple-clang
- [develop2] Can conan_provider.cmake work with add_subdirectory HOT 6
- find_program working when building from command line, but not when using the CLion Conan plugin HOT 11
- [bug] generated settings.yml missing Macos.version "14.2", causes build failures HOT 10
- [develop2, BUG] Unknown arguments specified in conan_provider.cmake:519 HOT 2
- Unable to cross compile openssl/3.x.x on develop2 HOT 6
- Using "build-scripts" package via tool_requires() not working HOT 2
- [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 20
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.