From 91baa541a7a88c7857340cab65e402b98fb9a795 Mon Sep 17 00:00:00 2001 From: Marco Ceriani Date: Fri, 20 Oct 2023 17:37:19 +0200 Subject: [PATCH 1/4] Build in build/Debug folder on linux when using a layout --- .../consuming_packages/the_flexibility_of_conanfile_py.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tutorial/consuming_packages/the_flexibility_of_conanfile_py.rst b/tutorial/consuming_packages/the_flexibility_of_conanfile_py.rst index 5dbfc4d26dbf..58a1ff294046 100644 --- a/tutorial/consuming_packages/the_flexibility_of_conanfile_py.rst +++ b/tutorial/consuming_packages/the_flexibility_of_conanfile_py.rst @@ -243,11 +243,11 @@ Check that running the same commands as in the previous examples without the :caption: Linux, macOS $ conan install . --build=missing - $ cd build - $ source ./Release/generators/conanbuild.sh + $ cd build/Release + $ source ./generators/conanbuild.sh Capturing current environment in deactivate_conanbuildenv-release-x86_64.sh Configuring environment variables - $ cmake .. -DCMAKE_TOOLCHAIN_FILE=Release/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release + $ cmake ../.. -DCMAKE_TOOLCHAIN_FILE=generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release $ cmake --build . ... Building with CMake version: 3.22.6 From 0aaf6d9cb602c417fca8940f9836c5e583b31403 Mon Sep 17 00:00:00 2001 From: Juan Sanchez Date: Tue, 24 Oct 2023 17:03:21 +0200 Subject: [PATCH 2/4] fix to path with the new changes --- tutorial/consuming_packages/the_flexibility_of_conanfile_py.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorial/consuming_packages/the_flexibility_of_conanfile_py.rst b/tutorial/consuming_packages/the_flexibility_of_conanfile_py.rst index 58a1ff294046..6922669a7588 100644 --- a/tutorial/consuming_packages/the_flexibility_of_conanfile_py.rst +++ b/tutorial/consuming_packages/the_flexibility_of_conanfile_py.rst @@ -258,7 +258,7 @@ Check that running the same commands as in the previous examples without the Uncompressed size is: 233 Compressed size is: 147 ZLIB VERSION: 1.2.11 - $ source ./Release/generators/deactivate_conanbuild.sh + $ source ./generators/deactivate_conanbuild.sh There's no need to always write this logic in the `conanfile.py`. There are some pre-defined layouts you can import and directly use in your recipe. For example, for the From 96863fa17fb80c39a9537fc024960c87014460af Mon Sep 17 00:00:00 2001 From: Juan Sanchez Date: Wed, 25 Oct 2023 18:17:38 +0200 Subject: [PATCH 3/4] updated conanfile.py in tutorial --- tutorial/consuming_packages/the_flexibility_of_conanfile_py.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/tutorial/consuming_packages/the_flexibility_of_conanfile_py.rst b/tutorial/consuming_packages/the_flexibility_of_conanfile_py.rst index 6922669a7588..c172b768825d 100644 --- a/tutorial/consuming_packages/the_flexibility_of_conanfile_py.rst +++ b/tutorial/consuming_packages/the_flexibility_of_conanfile_py.rst @@ -202,6 +202,7 @@ platform without adding more changes. self.folders.generators = os.path.join("build", "generators") else: self.folders.generators = os.path.join("build", str(self.settings.build_type), "generators") + self.folders.build = os.path.join("build", str(self.settings.build_type)) As you can see, we defined the **self.folders.generators** attribute in the `layout()` From 99ffd548b3693d79676310a87b86d036f37a017e Mon Sep 17 00:00:00 2001 From: Juan Sanchez Date: Fri, 27 Oct 2023 17:30:32 +0200 Subject: [PATCH 4/4] reflect changes made to files --- tutorial/consuming_packages/the_flexibility_of_conanfile_py.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/tutorial/consuming_packages/the_flexibility_of_conanfile_py.rst b/tutorial/consuming_packages/the_flexibility_of_conanfile_py.rst index c172b768825d..1f28d7809fd5 100644 --- a/tutorial/consuming_packages/the_flexibility_of_conanfile_py.rst +++ b/tutorial/consuming_packages/the_flexibility_of_conanfile_py.rst @@ -200,6 +200,7 @@ platform without adding more changes. multi = True if self.settings.get_safe("compiler") == "msvc" else False if multi: self.folders.generators = os.path.join("build", "generators") + self.folders.build = "build" else: self.folders.generators = os.path.join("build", str(self.settings.build_type), "generators") self.folders.build = os.path.join("build", str(self.settings.build_type))