diff --git a/conan/tools/cmake/cmake.py b/conan/tools/cmake/cmake.py index d30e4274f0b..716e6afd1d7 100644 --- a/conan/tools/cmake/cmake.py +++ b/conan/tools/cmake/cmake.py @@ -56,7 +56,7 @@ def __init__(self, conanfile): configure_preset = get_configure_preset(cmake_presets, conanfile) self._generator = configure_preset["generator"] - self._toolchain_file = configure_preset["toolchainFile"] + self._toolchain_file = configure_preset.get("toolchainFile") self._cache_variables = configure_preset["cacheVariables"] self._cmake_program = "cmake" # Path to CMake should be handled by environment