Fix patch command

This commit is contained in:
Lncvrt committed 2026-03-11 22:21:02 -07:00
1 parent 48ab4a5203
commit c23baefd95
2 files changed
+8 -1

No files matched your search

+1
View File
@@ -13,6 +13,7 @@ CMakeUserPresets.json
build/
.cache/
.DS_Store
patch_cjson.cmake
# CLion
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
+7 -1
View File
@@ -9,11 +9,17 @@ find_package(CURL REQUIRED)
include(FetchContent)
file(WRITE ${CMAKE_SOURCE_DIR}/patch_cjson.cmake "
file(READ \"\${FILE}\" content)
string(REPLACE \"cmake_minimum_required(VERSION 3.0)\" \"cmake_minimum_required(VERSION 3.10)\" content \"\${content}\")
file(WRITE \"\${FILE}\" \"\${content}\")
")
FetchContent_Declare(
cjson
GIT_REPOSITORY https://github.com/DaveGamble/cJSON.git
GIT_TAG v1.7.19
PATCH_COMMAND sed -i "" "s/cmake_minimum_required(VERSION 3.0)/cmake_minimum_required(VERSION 3.10)/" CMakeLists.txt
PATCH_COMMAND ${CMAKE_COMMAND} -DFILE=CMakeLists.txt -P ${CMAKE_SOURCE_DIR}/patch_cjson.cmake
UPDATE_DISCONNECTED TRUE
)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)