From 98cdffe5fd072c40528e34cd825c2ec7db4117ad Mon Sep 17 00:00:00 2001 From: Marco Antonio Jaguaribe Costa Date: Mon, 9 Dec 2024 13:52:14 -0300 Subject: [PATCH] (actually) fix broken MS2022 behavior a recent Visual Studio update introduced an error unless there is a CMakePresets.json file present, completely blowing up the previous setup. after this commit, you should either delete the CMakeUserPresets.json file from your root or add it to your system - NOT repo! - excludesFile: https://stackoverflow.com/questions/7335420/global-git-ignore --- .gitignore | 2 +- cmake/CopyUserPresetTemplate.cmake | 4 ++-- cmake/presets/{CMakeUserPresets.json => CMakePresets.json} | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename cmake/presets/{CMakeUserPresets.json => CMakePresets.json} (100%) diff --git a/.gitignore b/.gitignore index e91f37426..6466f05cb 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,6 @@ /.vs/ /build/ /out/ +/CMakePresets.json /CMakeSettings.json -/CMakeUserPresets.json /lib/ diff --git a/cmake/CopyUserPresetTemplate.cmake b/cmake/CopyUserPresetTemplate.cmake index 484f7ec80..fda0af34b 100644 --- a/cmake/CopyUserPresetTemplate.cmake +++ b/cmake/CopyUserPresetTemplate.cmake @@ -5,7 +5,7 @@ function(CopyUserPresetTemplate) NOT EXISTS "${CMAKE_SOURCE_DIR}/CMakePresets.json" AND NOT EXISTS "${CMAKE_SOURCE_DIR}/CMakeUserPresets.json" ) - file(COPY "${CMAKE_SOURCE_DIR}/cmake/presets/CMakeUserPresets.json" DESTINATION "${CMAKE_SOURCE_DIR}") - message(FATAL_ERROR "No existing preset was found, copied a preset template to ${CMAKE_SOURCE_DIR}/CMakeUserPresets.json.") + file(COPY "${CMAKE_SOURCE_DIR}/cmake/presets/CMakePresets.json" DESTINATION "${CMAKE_SOURCE_DIR}") + message(FATAL_ERROR "No existing preset was found, copied a preset template to ${CMAKE_SOURCE_DIR}/CMakePresets.json.") endif() endfunction() diff --git a/cmake/presets/CMakeUserPresets.json b/cmake/presets/CMakePresets.json similarity index 100% rename from cmake/presets/CMakeUserPresets.json rename to cmake/presets/CMakePresets.json