Files
source/cmake/CopyUserPresetTemplate.cmake
T
Marco Antonio Jaguaribe Costaandmajcosta 98cdffe5fd (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
2024-12-09 14:19:25 -03:00

12 lines
460 B
CMake

function(CopyUserPresetTemplate)
if(
NOT DEFINED Languages AND
NOT DEFINED Applications AND
NOT EXISTS "${CMAKE_SOURCE_DIR}/CMakePresets.json" AND
NOT EXISTS "${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()