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
Add new layout() test for projects sharing common code in parent folders #11556
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works 🚀
The downside to the custom layout is losing the generator folder being set by cmake_layout
and it's handling around the conf and multi
conan/tools/cmake/layout.py
Outdated
@@ -14,13 +14,13 @@ def cmake_layout(conanfile, generator=None, src_folder="."): | |||
else: | |||
multi = False | |||
|
|||
conanfile.folders.source = src_folder | |||
conanfile.folders.source = src_folder if not subfolder else os.path.join(subfolder, src_folder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sub folder is above source dir? 😕 Is that from the perspective of the root folder?
Maybe "nested" or "project" not sure whats better, maybe some is enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the idea is that subfolder
is from the "root" folder, to get you back to the subproject folder where the conanfile.py is. And then, the src_folder
defines the source folder within that subproject (typically, where the CMakeLists.txt of that subproject is)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think understanding why going to ..
to later come back to pkg
is too much. There is no way a "subfolder" argument will be interpreted and used in the correct way.
I have changed the approach, with a |
Co-authored-by: Luis Martinez <lasote@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 subproject is a more clear name
Changelog: Feature: Added a new
self.folders.subproject
forlayout()
to be able to define layouts that goes up to the parent or siblings folders, together with theself.folders.root = ".."
.Docs: conan-io/docs#2662