mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-07-11 02:16:39 +02:00
66b073ab8d
Composite PR for several changes to CPMUtil, most notably: - https://git.crueter.xyz/CMake/CPMUtil/pulls/19 - https://git.crueter.xyz/CMake/CPMUtil/pulls/22 - https://git.crueter.xyz/CMake/CPMUtil/pulls/24 - https://git.crueter.xyz/CMake/CPMUtil/pulls/25 These contain a lot of changes that generally simplify control flow and improve ease-of-use. Read those descriptions and patchsets for more info. Signed-off-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4130 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
38 lines
977 B
Bash
Executable File
38 lines
977 B
Bash
Executable File
#!/bin/sh -e
|
|
|
|
# SPDX-FileCopyrightText: Copyright 2026 crueter
|
|
# SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
SUBMODULES="$(git submodule status --recursive | cut -c2-)"
|
|
: "${SUBMODULES:?No submodules defined!}"
|
|
|
|
IFS="
|
|
"
|
|
for i in $SUBMODULES; do
|
|
commit=$(echo "$i" -d" " -f1 | cut -c1-10)
|
|
short_commit=$(echo "$i" -d" " -f1 | cut -c1-7)
|
|
|
|
ref=$(echo "$i" | cut -d" " -f3 | tr -d '()')
|
|
|
|
case "$ref" in
|
|
# ref == commit, use commit versioning
|
|
"$short_commit") version="$commit" ;;
|
|
# ref is a branch, use commit versioning
|
|
heads/*) version="$commit" ;;
|
|
# ref is (probably) a tag, use tag versioning
|
|
*) version="$ref" ;;
|
|
esac
|
|
|
|
path=$(echo "$i" | cut -d" " -f2)
|
|
name=$(echo "$path" | awk -F/ '{print $NF}')
|
|
|
|
remote=$(git -C "$path" remote get-url origin)
|
|
|
|
host=$(echo "$remote" | cut -d"/" -f3)
|
|
|
|
repo=$(echo "$remote" | cut -d"/" -f4-5 | cut -d'.' -f1)
|
|
|
|
cmake -DKEY="$name" -DVERSION="$version" -DREPO="$repo" -DGIT_HOST="$host" \
|
|
-P "$CMAKE/package/add.cmake"
|
|
done
|