Skip to content

Commit

Permalink
Merge pull request #2668 from conan-io/master
Browse files Browse the repository at this point in the history
Merge master to develop
  • Loading branch information
czoido committed Jul 28, 2022
2 parents 73e8609 + 32e1dc2 commit 9736480
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 22 deletions.
20 changes: 10 additions & 10 deletions developing_packages/editable_packages.rst
Expand Up @@ -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 .
Expand All @@ -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
Expand All @@ -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!
Expand All @@ -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 .
Expand All @@ -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!
Expand Down
12 changes: 9 additions & 3 deletions migrating_to_2.0/recipes.rst
Expand Up @@ -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")
Expand Down Expand Up @@ -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.
4 changes: 2 additions & 2 deletions reference/conanfile/tools/cmake/cmake_layout.rst
Expand Up @@ -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:
Expand All @@ -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:

Expand Down
13 changes: 7 additions & 6 deletions reference/conanfile/tools/cmake/cmaketoolchain.rst
Expand Up @@ -297,22 +297,23 @@ 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
+++++

``CMakeToolchain`` is affected by these :ref:`[conf]<global_conf>` variables:

- ``tools.cmake.cmaketoolchain:generator`` CMake generator to be used by cmake CLI. See all the CMake generators `here <https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#cmake-generators>`__.
- ``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``.
Expand Down
6 changes: 5 additions & 1 deletion reference/conanfile/tools/files/basic.rst
Expand Up @@ -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.
Expand All @@ -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()
-------------------------
Expand Down
9 changes: 9 additions & 0 deletions videos.rst
Expand Up @@ -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

<iframe width="560" height="315" src="https://www.youtube.com/embed/kKGglzm5ous" frameborder="0" allow="autoplay; encrypted-media; allowfullscreen>
</iframe>
<br/><br/>
- Conan in Practice: Interactive Exercises of common commands
Expand Down

0 comments on commit 9736480

Please sign in to comment.