conan-io / docs

conan.io reStructuredText documentation
http://docs.conan.io
MIT License
110 stars 361 forks source link

Tutorial suggests that configuration will be set in the toolchain file, but it appears not to be #3776

Closed markspacehub closed 5 months ago

markspacehub commented 5 months ago

In the tutorial: consuming_packages/different_configurations it states: " This :command:conan install command will check if we already have the required libraries in the local cache (Zlib) for Debug configuration and obtain them if not. It will also set the build configuration in the conan_toolchain.cmake toolchain that the CMakeToolchain generator creates so that when we build the application it's built in Debug configuration. Now build your project as you did in the previous examples and check in the output how it was built in Debug configuration: "

But when examining the toolchain file, no mention of 'Debug' (or 'Release') occur. Furthermore the cli commands for invoking cmake (on Linux/macOS) includes: $ cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Debug This implies that the build type is not specified in the toolchain file? Does the tutorial need updating?

memsharded commented 5 months ago

Hi @markspacehub

Thanks for the report.

Indeed, I think the text referred mostly to the output of the CMakeToolchain generator, which initially was only the conan_toolchain.cmake. But soon it also started to generate a CMakePresets.json file, and the CMAKE_BUILD_TYPE is stored there, not in the conan_toolchain.cmake.

So I agree the docs could be a bit more explicit, I'll try to add a clarification.

markspacehub commented 5 months ago

Hi @memsharded I had noticed the CMakePresets.json file, I was wondering if that will me mentioned later in the tutorial? Or is this point a good place to introduce it?

memsharded commented 5 months ago

I am adding a clarification in the place you suggested, as well as an intro earlier in the tutorial in https://github.com/conan-io/docs/pull/3777

markspacehub commented 5 months ago

Nice - thanks for the quick response :)