Closed BjarneLorenzen closed 3 weeks ago
Hi @BjarneLorenzen
Thanks for your question.
Not sure what do you mean exactly. But if you want to create your own layouts and reuse them, it is possible:
def mylayout(conanfile)
function inside a python_requires
recipepython_requires = "mypythonlayout/version"
self.python_requires["mypythonlayout"].module.mylayout(self)
inside the layout()
methodYou can check https://docs.conan.io/2/reference/extensions/python_requires.html#reference-extensions-python-requires for more information.
Please let me know if this is what you want.
Otherwise, cmake_layout
has some customizations via conf
:
$ conan config list
tools.cmake.cmake_layout:build_folder: (Experimental) Allow configuring the base folder of the build for local builds
tools.cmake.cmake_layout:build_folder_vars: Settings and Options that will produce a different build folder and different CMake presets names
tools.cmake.cmake_layout:test_folder: (Experimental) Allow configuring the base folder of the build for test_package
Thanks for the quick response, that approach would work for me. I just want to avoid having the lengthy layout code inside every recipe.
Thanks for the quick response, that approach would work for me. I just want to avoid having the lengthy layout code inside every recipe.
Sure, to reuse code among different recipes, the python_requires
is the way to go. The feature allows not only to reuse, but also to control the re-build of packages when you want, based on the version changes of the python_requires
.
Thanks to you for the feedback!
What is your question?
Is there a way to define custom layout functions that can be used as the predefined ones like
cmake_layout(self)
?Have you read the CONTRIBUTING guide?