aboutsummaryrefslogtreecommitdiff
path: root/tools/cpm/cmake/update.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'tools/cpm/cmake/update.cmake')
-rwxr-xr-xtools/cpm/cmake/update.cmake33
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/cpm/cmake/update.cmake b/tools/cpm/cmake/update.cmake
new file mode 100755
index 0000000000..79c1fa1d00
--- /dev/null
+++ b/tools/cpm/cmake/update.cmake
@@ -0,0 +1,33 @@
+#!/usr/bin/env -S cmake -P
+
+# SPDX-FileCopyrightText: Copyright 2026 crueter
+# SPDX-License-Identifier: LGPL-3.0-or-later
+
+cmake_minimum_required(VERSION 3.31)
+
+include(${CMAKE_CURRENT_LIST_DIR}/ScriptUtils.cmake)
+
+# Update CPMUtil and its tooling/etc
+set(pwd ${CMAKE_SOURCE_DIR})
+
+set(host "https://git.crueter.xyz")
+set(repo "CMake/CPMUtil")
+set(release "releases/download/continuous")
+set(filename CPMUtil.tar.zst)
+
+mktempdir(TMP)
+
+# Download tarball
+set(url "${host}/${repo}/${release}/${filename}")
+set(file ${TMP}/${filename})
+
+cpm_download(${url} ${file})
+
+# Extract to current working directory
+file(ARCHIVE_EXTRACT
+ INPUT ${file}
+ DESTINATION ${pwd})
+
+# done :)
+echo("Updated CPMUtil")
+file(REMOVE_RECURSE ${TMP}) \ No newline at end of file