Open mrjoel opened 1 year ago
conancenter considers CMake as a standard tool installed on build machine of consumers, but not if CMake min required version of upstream CMakeLists is greater than 3.15, which is the case for Qt6.
Actually, since it is now possible for users to always prevent some build requirements by defining them in [system_tools]
of their profile, I think that we should always add cmake to build requirements even if min CMake version is lower than 3.15
Actually, since it is now possible for users to always prevent some build requirements by defining them in [system_tools] of their profile, I think that we should always add cmake to build requirements even if min CMake version is lower than 3.15
This would also save us from modifying recipes trivially just to add this because we don't have the same environmental assumptions about build tool presence on build agents.
A proposal for conancenter could be:
Add cmake
recipe to build requirements of all CMake based recipes:
self.tool_requires(cmake/[>=3.15 <4])
(because CMakeToolchain requires at least CMake 3.15)Example:
cmake_minimum_required(VERSION 2.8.12)
=> self.tool_requires(cmake/[>=3.15 <4])
cmake_minimum_required(VERSION 3.12)
=> self.tool_requires(cmake/[>=3.15 <4])
cmake_minimum_required(VERSION 3.16)
=> self.tool_requires(cmake/[>=3.16 <4])
cmake_minimum_required(VERSION 3.22)
=> self.tool_requires(cmake/[>=3.22 <4])
[system_tools]
cmake/3.15.0
Document for consumers how to prevent this build requirement if they have CMake on their build machine. For example, if you have CMake 3.27.5 on your build machine, add this to your profiles:
[system_tools]
cmake/3.27.5
And to avoid duplication if you have many profiles, create a _cmake
file in ~/.conan2/profiles
folder with only above code, and add include(_cmake)
on top of all your profiles.
Description
The Qt 6.x.x conanfile.py uses CMake as a tool_requires: https://github.com/conan-io/conan-center-index/blob/master/recipes/qt/6.x.x/conanfile.py#L376.
However, according to https://github.com/conan-io/conan-center-index/blob/master/docs/faqs.md#why-recipes-that-use-build-tools-like-cmake-that-have-packages-in-conan-center-do-not-use-it-as-a-build-require-by-default it should be considered as a standard build system tool and not required to be listed specifically (or have a Conan package tool_requires dependency).
Package and Environment Details
N/A
Conan profile
N/A
Steps to reproduce
N/A
Logs
N/A