-
Notifications
You must be signed in to change notification settings - Fork 378
Description
All the examples of the tutorial build the code directly inside the folder build. This is fine for Visual Studio, and is a good approach for the initial pages, when the reader is still learning conan concepts. However, after introducing the concept of layouts, the example still compiles under build, while it should build inside build/Debug and build/Release.
If I follow the tutorial with the project tutorial/consuming_packages/conanfile_py, the build instructions provided are
$ conan install . --build=missing
$ cd build
$ source ./Release/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 --build .
This will put all cmake files, and all compiled files, in the same folder for both the configuration Debug and Release. Instead, if I have cmake 3.23 or newer and I use the cmake presets, the build folders are correctly set to build/Debug and build/Release respectively for the two settings.
Since there are people who are still using older versions of cmake, I propose to change the tutorial to
$ conan install . --build=missing
$ cd build/Release
$ source ./generators/conanbuild.sh
Capturing current environment in deactivate_conanbuildenv-release-x86_64.sh
Configuring environment variables
$ cmake ../.. -DCMAKE_TOOLCHAIN_FILE=generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release
$ cmake --build .