aboutsummaryrefslogtreecommitdiff
path: root/tools/cpm/cmake/package/fetch.cmake
blob: f2b678de01b882cb8588418b33c7ee7b02950de4 (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
34
#!/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)

function(usage)
    echo([=[
Usage: cpmutil.sh package fetch [-a|--all] [PACKAGE]...

Fetch the specified package or packages from their defined download locations.
If the package is already cached, it will not be re-fetched.

Options:
    -a, --all       Operate on all packages in this project.
]=])
endfunction()

set(NO_CI TRUE)
parse_script_args(args)

foreach(key ${args})
    if (ci)
        continue()
    endif()

    parse_key(${key})
    echo("-- ${key}")

    fetch_package_object()
endforeach()