aboutsummaryrefslogtreecommitdiff
path: root/tools/cpm/cmake/update.cmake
blob: 79c1fa1d009b61344c64958725c4e626de51ff76 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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})