question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[question] Can't use layouts when also using generators

See original GitHub issue

Starting with the example editable project from https://github.com/conan-io/examples.git

cd examples/features/editable/cmake
perl -i -ne 's/add /add --layout=\$(readlink -f layout.ini) /g;print;' build.sh
# Now run the build.sh
./build.sh

If I look for the marker directory BLAHHHH I can’t find it anywhere. The code

    def generate(self):
        tc = CMakeToolchain(self)
        tc.generate()

Makes the layout file get ignored.

I don’t know how to get past this issue since I need to be able to configure the library location ( layout ) for an editable package AND I need to be able to use the generated conan_toolchain.cmake.

If I commented out the “def generate” …section, then the layout works BUT I don’t have the generated conan_toolchain.cmake file

Thanks for any help

layout.txt

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
purplefishiescommented, Jul 14, 2022

OK, got what you were saying. I just did

def layout(): 
    cmake_layout(self,src_folder="DIR")
    # Followed by 
    self.folders.build += "PACKAGE/src"
0reactions
purplefishiescommented, Jul 14, 2022

What is the best practice way of doing that ? Configuring at the conanfile.py level ?

I saw that there’s a way to customize it through custom_conf but I can’t find any examples to add multiple values without changing the layout.py file .

Read more comments on GitHub >

github_iconTop Results From Across the Web

[bug] layout: self.folders.generators not working like --install ...
Hi @heili77. This is expected. The new layout() generators folder only applies to the new generators, those in from conan.tools.xxxx ...
Read more >
Where did the Layout Generator go?
Short answer: It was renamed to Shapes to better reflect what it does. To use the Shapes (Layout Generator) device, follow these steps:....
Read more >
Another Space Plan Generator/Space Layout question
I'm using my building footprint as the site outline, so there doesn't need to be any empty space. I can't find an input...
Read more >
Code Generators or T4 Templates, are they really evil?
Generics solve one problem, code-generators solve another. ... In my case, I use T4 to generate Entities, DAL and BLL based on a...
Read more >
Creating and Customizing Rails Generators & Templates
You can also use append_file and prepend_file in the same way to place code at the beginning and end of a file respectively....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found