diff --git a/developing_packages/editable_packages.rst b/developing_packages/editable_packages.rst index 7e034b8bbce..873aaa6a46c 100644 --- a/developing_packages/editable_packages.rst +++ b/developing_packages/editable_packages.rst @@ -73,15 +73,15 @@ Now the ``say/0.1@user/channel`` package is in editable mode, lets build it loca # windows, we will build 2 configurations to show multi-config $ conan install . -s build_type=Release $ conan install . -s build_type=Debug - $ mkdir build && cd build - $ cmake .. -DCMAKE_TOOLCHAIN_FILE=conan/conan_toolchain.cmake + $ cd build + $ cmake .. -DCMAKE_TOOLCHAIN_FILE=generators/conan_toolchain.cmake $ cmake --build . --config Release $ cmake --build . --config Debug # Linux, we will only build 1 configuration $ conan install . - $ mkdir cmake-build-release && cd cmake-build-release - $ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=conan/conan_toolchain.cmake + $ cd build/Release + $ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=generators/conan_toolchain.cmake $ cmake --build . @@ -98,8 +98,8 @@ In this case we can build the ``hello`` application as usual: # windows, we will build 2 configurations to show multi-config $ conan install . -s build_type=Release $ conan install . -s build_type=Debug - $ mkdir build && cd build - $ cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake + $ cd build + $ cmake .. -DCMAKE_TOOLCHAIN_FILE=generators/conan_toolchain.cmake $ cmake --build . --config Release $ cmake --build . --config Debug $ Release\hello.exe @@ -109,8 +109,8 @@ In this case we can build the ``hello`` application as usual: # Linux, we will only build 1 configuration $ conan install . - $ mkdir cmake-build-release && cd cmake-build-release - $ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake + $ cd build/Release + $ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=generators/conan_toolchain.cmake $ cmake --build . $ ./hello say/0.1: Hello World Release! @@ -134,7 +134,7 @@ Lets see it, lets start by doing a change in the ``say`` source code: $ cmake --build . --config Debug # Linux, we will only build 1 configuration - $ cd cmake-build-release + $ cd build/Release $ cmake --build . @@ -154,7 +154,7 @@ And build and run the "hello" project: say/0.1: Bye World Debug! # Linux - $ cd cmake-build-release + $ cd build/Release $ cmake --build . $ ./hello say/0.1: Bye World Release! diff --git a/migrating_to_2.0/recipes.rst b/migrating_to_2.0/recipes.rst index f9b54691786..1179f017f36 100644 --- a/migrating_to_2.0/recipes.rst +++ b/migrating_to_2.0/recipes.rst @@ -270,7 +270,6 @@ A typical anti-pattern in the recipes that can be solved with a ``layout()`` dec class Pkg(Conanfile): - @property def layout(self): basic_layout(self, src_folder="source") @@ -871,7 +870,14 @@ If any manipulation to the symlinks is required, the package :ref:`conan.tools.f contains some tools to help with that. +New tools for managing system package managers +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +There are some changes you should be aware of if you are migrating from +:ref:`systempackagetool` to the new :ref:`conan_tools_system_package_manager` to prepare +the recipe for Conan 2.0: - - +* Unlike in ``SystemPackageTool`` that uses ``CONAN_SYSREQUIRES_SUDO`` and is set to ``True`` + as default, the ``tools.system.package_manager:sudo`` configuration is ``False`` by default. +* :ref:`systempackagetool` is initialized with ``default_mode='enabled'`` but for these new + tools ``tools.system.package_manager:mode='check'`` by default. diff --git a/reference/conanfile/tools/cmake/cmake_layout.rst b/reference/conanfile/tools/cmake/cmake_layout.rst index 23dde0f6237..27c5ce9909e 100644 --- a/reference/conanfile/tools/cmake/cmake_layout.rst +++ b/reference/conanfile/tools/cmake/cmake_layout.rst @@ -62,7 +62,7 @@ conf to declare a list of settings or options: .. code:: bash - conan install . -c tools.cmake.cmake_layout:build_folder_vars='["settings.compiler", "options.shared"]' + conan install . -c tools.cmake.cmake_layout:build_folder_vars="['settings.compiler', 'options.shared']" For the previous example, the values assigned by the ``cmake_layout`` (installing the Release/static default configuration) would be: @@ -76,7 +76,7 @@ If we repeat the previous install with a different configuration: .. code:: bash - conan install . -o shared=True -c tools.cmake.cmake_layout:build_folder_vars='["settings.compiler", "options.shared"]' + conan install . -o shared=True -c tools.cmake.cmake_layout:build_folder_vars="['settings.compiler', 'options.shared']" The values assigned by the ``cmake_layout`` (installing the Release/shared configuration) would be: diff --git a/reference/conanfile/tools/cmake/cmaketoolchain.rst b/reference/conanfile/tools/cmake/cmaketoolchain.rst index bd26f6bf5c5..f88fe370b7e 100644 --- a/reference/conanfile/tools/cmake/cmaketoolchain.rst +++ b/reference/conanfile/tools/cmake/cmaketoolchain.rst @@ -297,15 +297,15 @@ so you can use the ``--preset`` argument from ``cmake >= 3.23`` or use an IDE: $ conan install . -s build_type=Debug # For single-configuration generator - $ cmake --preset Debug - $ cmake --build --preset Debug - $ cmake --preset Release - $ cmake --build --preset Release + $ cmake --preset debug + $ cmake --build --preset debug + $ cmake --preset release + $ cmake --build --preset release # For multi-configuration generator $ cmake --preset default - $ cmake --build --preset Debug - $ cmake --build --preset Release + $ cmake --build --preset debug + $ cmake --build --preset release conf @@ -313,6 +313,7 @@ conf ``CMakeToolchain`` is affected by these :ref:`[conf]` variables: +- ``tools.cmake.cmaketoolchain:generator`` CMake generator to be used by cmake CLI. See all the CMake generators `here `__. - ``tools.cmake.cmaketoolchain:toolchain_file`` user toolchain file to replace the ``conan_toolchain.cmake`` one. - ``tools.cmake.cmaketoolchain:user_toolchain`` list of user toolchains to be included from the ``conan_toolchain.cmake`` file. - ``tools.android:ndk_path`` value for ``ANDROID_NDK_PATH``. diff --git a/reference/conanfile/tools/files/basic.rst b/reference/conanfile/tools/files/basic.rst index 966426394e3..a35d92770f1 100644 --- a/reference/conanfile/tools/files/basic.rst +++ b/reference/conanfile/tools/files/basic.rst @@ -191,7 +191,7 @@ conan.tools.files.rmdir() .. code-block:: python - def rmdir(path) + def rmdir(conanfile, path) Utility functions to remove a directory. The existence of the specified directory is checked, so ``rmdir()`` will do nothing if the directory doesn't exists. @@ -208,6 +208,10 @@ Parameters: - **conanfile**: Conanfile object. - **path**: Path to the directory. +The behavior regarding the path is the same as Python ``shutil.rmtree``. The provided path can be +relative to the current folder (the current folder depends in which method this tool is used), or +it can be an absolute path. + conan.tools.files.chdir() ------------------------- diff --git a/videos.rst b/videos.rst index 02f1446228c..9ed19916944 100644 --- a/videos.rst +++ b/videos.rst @@ -14,6 +14,15 @@ Videos and links ================= +- ACCU 2022: Advanced Dependencies Model in Conan 2.0 C, C++ Package Manager by Diego Rodriguez-Losada + + .. raw:: html + +