Skip to content

Commit

Permalink
Fix issue #11752 (#11759)
Browse files Browse the repository at this point in the history
* Add testcase for issue #11752

* Fix issue #11752
  • Loading branch information
comargo committed Aug 3, 2022
1 parent 3417e1b commit 6cc963f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion conan/tools/cmake/cmake.py
Expand Up @@ -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
Expand Down
Expand Up @@ -814,6 +814,15 @@ def test_cmake_presets_multiple_settings_multi_config():
assert "MSVC_LANG2017" in client.out


@pytest.mark.tool_cmake(version="3.23")
def test_max_schema_version2_build():
client = TestClient(path_with_spaces=False)
client.run("new hello/0.1 --template=cmake_exe")
configs = ["-c tools.cmake.cmaketoolchain.presets:max_schema_version=2"]
client.run("install . {} -s compiler.cppstd=14".format(" ".join(configs)))
client.run("build .")


@pytest.mark.tool_cmake(version="3.23")
def test_user_presets_version2():
client = TestClient(path_with_spaces=False)
Expand Down

0 comments on commit 6cc963f

Please sign in to comment.