mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-21 21:29:41 +08:00

This reverts commit 36cefcf0a313bc0db207539ff9b29d1aef03446a. Apparently it was already working correctly and I just wasn't looking properly.
44 lines
1.3 KiB
Bash
Executable File
44 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Abort at the first error.
|
|
set -e
|
|
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
|
PROJECT_DIR="$( cd "${SCRIPT_DIR}/.." && pwd )"
|
|
|
|
# Make sure that environment variables are set properly
|
|
source /opt/rh/devtoolset-7/enable
|
|
export PATH="${CURA_BUILD_ENV_PATH}/bin:${PATH}"
|
|
export PKG_CONFIG_PATH="${CURA_BUILD_ENV_PATH}/lib/pkgconfig:${PKG_CONFIG_PATH}"
|
|
|
|
cd "${PROJECT_DIR}"
|
|
|
|
#
|
|
# Clone Uranium and set PYTHONPATH first
|
|
#
|
|
|
|
# Check the branch to use:
|
|
# 1. Use the Uranium branch with the branch same if it exists.
|
|
# 2. Otherwise, use the default branch name "master"
|
|
URANIUM_BRANCH="${CI_COMMIT_REF_NAME:-master}"
|
|
output="$(git ls-remote --heads https://github.com/Ultimaker/Uranium.git "${URANIUM_BRANCH}")"
|
|
if [ -z "${output}" ]; then
|
|
echo "Could not find Uranium banch ${URANIUM_BRANCH}, fallback to use master."
|
|
URANIUM_BRANCH="master"
|
|
fi
|
|
|
|
echo "Using Uranium branch ${URANIUM_BRANCH} ..."
|
|
git clone --depth=1 -b "${URANIUM_BRANCH}" https://github.com/Ultimaker/Uranium.git "${PROJECT_DIR}"/Uranium
|
|
export PYTHONPATH="${PROJECT_DIR}/Uranium:.:${PYTHONPATH}"
|
|
|
|
mkdir build
|
|
cd build
|
|
cmake3 \
|
|
-DCMAKE_BUILD_TYPE=Debug \
|
|
-DCMAKE_PREFIX_PATH="${CURA_BUILD_ENV_PATH}" \
|
|
-DURANIUM_DIR="${PROJECT_DIR}/Uranium" \
|
|
-DBUILD_TESTS=ON \
|
|
..
|
|
make
|
|
ctest3 --output-on-failure -T Test
|