[bug] missing CMakeUserPresets.json
See original GitHub issueConan 1.48.0 does not generate CMakeUserPresets.json
if conanfile.txt
used instead of .py
.
Probably this is duplicate of #11172.
Environment Details
- Operating System: linux
- Conan version: 1.48.0
Steps to reproduce
cd "$(mktemp -d)"
conan new hello/0.1 -m=cmake_exe
rm conanfile.py
echo -e "[generators]\nCMakeToolchain" > conanfile.txt
mkdir build
(cd build && conan install ..)
tree "$(pwd)"
Output
/tmp/tmp.6FdEpSMGTR
βββ CMakeLists.txt
βββ build
βΒ Β βββ CMakePresets.json
βΒ Β βββ conan.lock
βΒ Β βββ conan_toolchain.cmake
βΒ Β βββ conanbuildinfo.txt
βΒ Β βββ conaninfo.txt
βΒ Β βββ graph_info.json
βββ conanfile.txt
βββ include
βΒ Β βββ hello.h
βββ src
βΒ Β βββ hello.cpp
βΒ Β βββ main.cpp
βββ test_package
βββ conanfile.py
Issue Analytics
- State:
- Created a year ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Configure and build with CMake Presets in Visual Studio
CMakeUserPresets.json is for developers to save their own local builds. ... You'll see an error if you try to use the same Configure...
Read more >Proposal for buildPresets and testPresets in CMakePresets.json
A simple CMakePresets.json with build, configure, and test support could look ... may not inherit from presets in CMakeUserPresets.json.
Read more >CMake Project Manager: Support presets functionality
CMake upstream is getting at https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5169 the ability to configure a project with a CMakeSettings.json file.
Read more >How to change default-generated CMakeCache in VS Code
json file is for defining presets that could be useful to anyone, and a CMakeUserPresets.json file is for each user to define presets...
Read more >Why is it disallowed for project preset to inherit user preset?
CMake Error: Could not read presets from PATH: Project preset ... want to inherit anything from some random person's CMakeUserPresets.json ...
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
We have finally implemented https://github.com/conan-io/conan/pull/11348 to be released in Conan 1.49. So you can declare:
in the
conanfile.txt
to get theCMakeUserPresets.json
generated correctlyNo, the
.txt
will still be there. And the new CMake integration will still generate aCMakePresets.json
file, it is only theCMakeUserPresets.json
that might be generated under certain conditions (it is not already existing), and that might be used to aggregate multiple different configurations (each one might have a differentCMakePresets.json
in a different folder), but for this functionality to be manageable, alayout
is necessary, otherwise it becomes too messy. So it is theCMakeUserPresets.json
that only will be generated for more advanced cases that will require aconanfile.py
, while for simple usage aconanfile.txt
with theCMakePresets.json
would be the solution.