Skip to content
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

Conan: add an option that would help choosing between generating a .txt or a .py file #109

Closed
sdmg15 opened this issue Mar 7, 2024 · 2 comments

Comments

@sdmg15
Copy link

sdmg15 commented Mar 7, 2024

Hey thanks for writing this.
So it'd be nice to have such option. If this is a thing I'd love contributing by adding that.

@friendlyanon
Copy link
Owner

Seems reasonable. The reason I went with .py originally was because I wanted to make use of default_options and Conan 1 only had [requires] in the .txt version. I don't need the first one anymore and with Conan 2 there is now [test_requires] support in .txt as well.

friendlyanon added a commit that referenced this issue Mar 8, 2024
The .py file was useful mainly for Conan 1, where the .txt file lacked
features to control test and tool requirements and where the files are
generated. With the "layout.cmake_layout" setting the files are output
to "build/generators" instead of the current "conan" directory.

Fixes #109
@friendlyanon
Copy link
Owner

Unfortunately, using [layout].cmake_layout makes the generator output folder vary based on your profile. On Windows, it puts things in build/generators by default, but on *nix systems it puts things in build/<build_type>/generators. You could make this consistent across all platforms by setting tools.cmake.cmake_layout:build_folder_vars in the profile, but that's additional setup necessary on the user's end.

I'd say this is a big enough issue that I will have to turn this down and stay with the conanfile.py solution. Reverted in ff48153

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants