[bug] 1.49.0: KeyError: 'include' in CMakeToolchain generator
See original GitHub issueEnvironment Details (include every applicable attribute)
- Operating System+version: docker container running ubuntu:latest
- Compiler+version: g++ 11
- Conan version: 1.49.0
- Python version: 3.10.4
Steps to reproduce (Include if Applicable)
Create a folder containing the following files:
- Empty
CMakeLists.txt
- Empty
CMakePresets.json
CMakeUserPresets.json
containing only{}
(an empty file will give a different error)
Create a conanfile.py
with the following content:
from conan import ConanFile
class Recipe(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "CMakeToolchain"
def layout(self):
self.folders.generators = "conan"
run conan install .
Logs (Executed commands with output) (Include/Attach if Applicable)
Output using 1.49.0:
root@167b965bb085:~# conan install -pr:b=default -pr:h=default .
Configuration (profile_host):
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++
compiler.version=11
os=Linux
os_build=Linux
[options]
[build_requires]
[env]
Configuration (profile_build):
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++
compiler.version=11
os=Linux
os_build=Linux
[options]
[build_requires]
[env]
conanfile.py: Installing package
Requirements
Packages
Installing (downloading, building) binaries...
conanfile.py: Generator txt created conanbuildinfo.txt
conanfile.py: Generator 'CMakeToolchain' calling 'generate()'
conanfile.py: ERROR: Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/conans/client/generators/__init__.py", line 177, in write_generators
generator.generate()
File "/usr/local/lib/python3.10/dist-packages/conan/tools/cmake/toolchain/toolchain.py", line 178, in generate
write_cmake_presets(self._conanfile, toolchain, self.generator)
File "/usr/local/lib/python3.10/dist-packages/conan/tools/cmake/presets.py", line 124, in write_cmake_presets
if preset_path not in data["include"]:
KeyError: 'include'
ERROR: Error in generator 'CMakeToolchain': 'include'
Output using 1.48.2:
root@167b965bb085:~# conan install -pr:b=default -pr:h=default .
Configuration (profile_host):
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++
compiler.version=11
os=Linux
os_build=Linux
[options]
[build_requires]
[env]
Configuration (profile_build):
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++
compiler.version=11
os=Linux
os_build=Linux
[options]
[build_requires]
[env]
conanfile.py: Installing package
Requirements
Packages
Installing (downloading, building) binaries...
conanfile.py: Generator 'CMakeToolchain' calling 'generate()'
conanfile.py: Generator txt created conanbuildinfo.txt
conanfile.py: Aggregating env generators
conanfile.py: Generated conaninfo.txt
conanfile.py: Generated graphinfo
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Changelog — conan 1.49.0 documentation
Docs here; Feature: The CMakePresets.json (file generated when specified the CMakeToolchain generator) is appended with a new buildPresets after a conan ...
Read more >Keyerror 'include' on migrating models to sql server
I have a django application and have backend as Microsoft sql server. ... and same i am migrating, but i am getting below...
Read more >conanio/conan - Gitter
rcrudo on Freenode I'm using conan with CMake and one of the pakages I need to include uses pkg_check_modules (pkg-config). Conan is not...
Read more >conan-io/conan 1.49.0 on GitHub - NewReleases.io
New release conan-io/conan version 1.49.0 1.49.0 (02-Jun-2022) on ... Docs:; Feature: Add CMAKE_SYSROOT support for CMakeToolchain .
Read more >conan Changelog - pyup.io
Feature: Add `.user_presets_path` attribute to `CMakeToolchain` to customize ... Bugfix: Fixed the `cmake_paths`generator to set the root of the packages to ...
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
CMakePresets have a “vendor” section so that third party tools can add their information there.
Resolved in https://github.com/conan-io/conan/pull/11452