From 0f43842f30ae769705c7a18d3b87dfd31f0e3200 Mon Sep 17 00:00:00 2001 From: czoido Date: Wed, 30 Mar 2022 16:56:29 +0200 Subject: [PATCH 1/2] add docs --- reference/conanfile/tools/cmake/cmaketoolchain.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reference/conanfile/tools/cmake/cmaketoolchain.rst b/reference/conanfile/tools/cmake/cmaketoolchain.rst index 91e4600e7b4..62c2ed1062d 100644 --- a/reference/conanfile/tools/cmake/cmaketoolchain.rst +++ b/reference/conanfile/tools/cmake/cmaketoolchain.rst @@ -274,10 +274,12 @@ The following predefined blocks are available, and added in this order: - ``user_toolchain``: Allows to include user toolchains from the ``conan_toolchain.cmake`` file. If the configuration ``tools.cmake.cmaketoolchain:user_toolchain=["xxxx", "yyyy"]`` is defined, its values will be ``include(xxx)\ninclude(yyyy)`` as the first lines in ``conan_toolchain.cmake``. -- ``generic_system``: Defines ``CMAKE_GENERATOR_PLATFORM``, ``CMAKE_GENERATOR_TOOLSET``, ``CMAKE_C_COMPILER``, ``CMAKE_CXX_COMPILER`` and ``CMAKE_BUILD_TYPE`` +- ``generic_system``: Defines ``CMAKE_SYSTEM_NAME``, ``CMAKE_SYSTEM_VERSION``, ``CMAKE_SYSTEM_PROCESSOR``, + ``CMAKE_GENERATOR_PLATFORM``, ``CMAKE_GENERATOR_TOOLSET``, ``CMAKE_C_COMPILER``, + ``CMAKE_CXX_COMPILER`` and ``CMAKE_BUILD_TYPE`` - ``android_system``: Defines ``ANDROID_PLATFORM``, ``ANDROID_STL``, ``ANDROID_ABI`` and includes ``CMAKE_ANDROID_NDK/build/cmake/android.toolchain.cmake`` where ``CMAKE_ANDROID_NDK`` comes defined in ``tools.android:ndk_path`` configuration value. -- ``apple_system``: Defines ``CMAKE_SYSTEM_NAME``, ``CMAKE_SYSTEM_VERSION``, ``CMAKE_OSX_ARCHITECTURES``, ``CMAKE_OSX_SYSROOT`` for Apple systems. +- ``apple_system``: Defines ``CMAKE_OSX_ARCHITECTURES``, ``CMAKE_OSX_SYSROOT`` for Apple systems. - ``fpic``: Defines the ``CMAKE_POSITION_INDEPENDENT_CODE`` when there is a ``options.fPIC`` - ``arch_flags``: Defines C/C++ flags like ``-m32, -m64`` when necessary. - ``libcxx``: Defines ``-stdlib=libc++`` flag when necessary as well as ``_GLIBCXX_USE_CXX11_ABI``. From cb6d16e24dab0371c5943d60fb8f9f6a386e19fe Mon Sep 17 00:00:00 2001 From: czoido Date: Thu, 31 Mar 2022 12:17:16 +0200 Subject: [PATCH 2/2] minor changes --- reference/conanfile/tools/cmake/cmaketoolchain.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/conanfile/tools/cmake/cmaketoolchain.rst b/reference/conanfile/tools/cmake/cmaketoolchain.rst index 62c2ed1062d..cea797b7616 100644 --- a/reference/conanfile/tools/cmake/cmaketoolchain.rst +++ b/reference/conanfile/tools/cmake/cmaketoolchain.rst @@ -412,10 +412,10 @@ If ``user_toolchain`` is not defined and Conan detects it is cross-building, bec and host profiles contain different OS or architecture, it will try to define the following variables: -- ``CMAKE_SYSTEM_NAME``: ``tools.cmake.cmaketoolchain:system_name`` configuration if defined, - otherwise, it will try to autodetect it. This block will consider cross-building if not Apple - or Android systems (that is managed by other blocks), and not 64bits to 32bits builds in x86_64, sparc and - ppc systems. +- ``CMAKE_SYSTEM_NAME``: ``tools.cmake.cmaketoolchain:system_name`` configuration if + defined, otherwise, it will try to autodetect it. This block will consider + cross-building if Android systems (that is managed by other blocks), and not 64bits to + 32bits builds in x86_64, sparc and ppc systems. - ``CMAKE_SYSTEM_VERSION``: ``tools.cmake.cmaketoolchain:system_version`` conf if defined, otherwise ``os.version`` subsetting (host) when defined - ``CMAKE_SYSTEM_PROCESSOR``: ``tools.cmake.cmaketoolchain:system_processor`` conf if defined, otherwise