update cpm and json

This commit is contained in:
matcool 2023-05-01 10:02:10 -03:00
parent 91ad04b86c
commit cac5673ed7
No known key found for this signature in database
GPG key ID: BF58756086D7AB1C
2 changed files with 15 additions and 3 deletions

View file

@ -73,7 +73,7 @@ include(cmake/GeodeFile.cmake)
include(cmake/Platform.cmake)
include(cmake/CPM.cmake)
CPMAddPackage("gh:geode-sdk/json#cef9c64")
CPMAddPackage("gh:geode-sdk/json#19cf6f4")
CPMAddPackage("gh:fmtlib/fmt#9.1.0")
CPMAddPackage("gh:gulrak/filesystem#3e5b930")

View file

@ -1,4 +1,4 @@
set(CPM_DOWNLOAD_VERSION 0.36.0)
set(CPM_DOWNLOAD_VERSION 0.38.1)
if(CPM_SOURCE_CACHE)
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
@ -10,12 +10,24 @@ endif()
# Expand relative path. This is important if the provided path contains a tilde (~)
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)
if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION}))
function(download_cpm)
message(STATUS "Downloading CPM.cmake to ${CPM_DOWNLOAD_LOCATION}")
file(DOWNLOAD
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
${CPM_DOWNLOAD_LOCATION}
)
endfunction()
if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION}))
download_cpm()
else()
# resume download if it previously failed
file(READ ${CPM_DOWNLOAD_LOCATION} check)
if("${check}" STREQUAL "")
download_cpm()
endif()
unset(check)
endif()
include(${CPM_DOWNLOAD_LOCATION})