[question] How to choose which cmake version to use for build()?
See original GitHub issueconan install .. --build missing
- Centos 7 (cmake is defaulted to cmake2)
How can I change the command to use?
Adding conan_cmake_program = cmake3 # environment CONAN_CMAKE_PROGRAM (overrides the make program used in CMake.cmake_program)
in conan.conf didn’t change anything, it still uses cmake
.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
[question] How to properly specify cmake version as ... - GitHub
I am learning how to use the build_requires, for example, as described in this webinar. I have cmake 3.18.2 installed locally.
Read more >CMake: how to specify the version of Visual C++ to work with?
First you can check what generators your CMake version does support (and how they are named): > cmake.exe --help ... The following generators...
Read more >CMake 3.25.1 Documentation
To build a software project with CMake, Generate a Project Buildsystem. Optionally use cmake to Build a Project, Install a Project or just...
Read more >Common Problems and Solutions – More Modern CMake
Solution: Either set a high minimum version or use the version range feature and CMake 3.12 or better. The lowest version you should...
Read more >Get started with CMake Tools on Linux - Visual Studio Code
Open the Command Palette (Ctrl+Shift+P) and run CMake: Select a Kit. The extension will automatically scan for kits on your computer and create...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @alexisfrjp,
In that case, you can try to prepend a path to the
PATH
where you create a symbolink link to the cmake3 binary and then add a[buildenv]
section to your profile. For example:Add the
buildenv
section to your profile, the folder will be prepended to the path each time Conan invokes thebuild()
method (the(path)
keyword stands for the currentPATH
variable):Be aware that you have to set:
tools.env.virtualenv:auto_use=True
configuration so that this is automatically applied to the build. You can do that in the command line:or adding it to the global.conf file.
Hope this helps.
Hi @alexisfrjp,
Be aware that the
CONAN_CMAKE_PROGRAM
environment variable does not work with the new integrations that are imported from the moduleconan
, just for the old one that is imported from the moduleconans
(note the extra ‘s’). So if you have in your recipe something like “from conan.tools.cmake import CMake” that may be the reason that the variable is not affecting the cmake run by build().Anyway, at Conan level, what you can do is use a tool_requires in your profile, so that it will affect all the packages that need to be built. You can do that by adding setting something like:
Conan Center Index has CMake packages for versions that vary from 3.15, to 3.23, so you can select the one that is more adequate for you.
Hope this helps.