Giter Site home page Giter Site logo

Comments (11)

tonka3000 avatar tonka3000 commented on July 20, 2024 1

Hey @memsharded ,

You can close it

from cmake-conan.

memsharded avatar memsharded commented on July 20, 2024

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.

tonka3000 avatar tonka3000 commented on July 20, 2024

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.

memsharded avatar memsharded commented on July 20, 2024

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.

tonka3000 avatar tonka3000 commented on July 20, 2024

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.

tonka3000 avatar tonka3000 commented on July 20, 2024

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.

lasote avatar lasote commented on July 20, 2024

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.

tonka3000 avatar tonka3000 commented on July 20, 2024

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.

memsharded avatar memsharded commented on July 20, 2024

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.

tonka3000 avatar tonka3000 commented on July 20, 2024

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.

memsharded avatar memsharded commented on July 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.