cmake commands

This commit is contained in:
tooomm 2026-07-24 22:50:02 +02:00
parent f9997328c6
commit 4cb5eb31e2

View file

@ -131,8 +131,6 @@ if [[ ! $BUILD_DIR ]]; then
BUILD_DIR="build" BUILD_DIR="build"
fi fi
# TODO check BUILD_DIR logic # TODO check BUILD_DIR logic
mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR"
# Set minimum CMake Version # Set minimum CMake Version
export CMAKE_POLICY_VERSION_MINIMUM=3.10 export CMAKE_POLICY_VERSION_MINIMUM=3.10
@ -266,13 +264,14 @@ fi
echo "::group::Configure CMake" echo "::group::Configure CMake"
cmake --version cmake --version
echo "Running CMake configuration with following flags: ${flags[*]}" echo "Running CMake configuration with following flags: ${flags[*]}"
cmake .. "${flags[@]}" cmake -S . -B "$BUILD_DIR" "${flags[@]}"
# cmake -S .. -B "$BUILD_DIR" "${flags[@]}"
echo "::endgroup::" echo "::endgroup::"
# Build # Build
echo "::group::Build project" echo "::group::Build project"
echo "Running CMake with following build flags: ${buildflags[*]}" echo "Running CMake with following build flags: ${buildflags[*]}"
cmake --build . "${buildflags[@]}" cmake --build "$BUILD_DIR" "${buildflags[@]}"
echo "::endgroup::" echo "::endgroup::"
# Post-build ccache # Post-build ccache
@ -308,26 +307,28 @@ fi
# Test # Test
if [[ $MAKE_TEST ]]; then if [[ $MAKE_TEST ]]; then
echo "::group::Run tests" echo "::group::Run tests"
ctest -C "$BUILDTYPE" --output-on-failure ctest --version
ctest --build-config "$BUILDTYPE" --test-dir "$BUILD_DIR" --output-on-failure
echo "::endgroup::" echo "::endgroup::"
fi fi
# Install # Install
if [[ $MAKE_INSTALL ]]; then if [[ $MAKE_INSTALL ]]; then
echo "::group::Install" echo "::group::Install"
cmake --build . --target install --config "$BUILDTYPE" cmake --build "$BUILD_DIR" --target install --config "$BUILDTYPE"
# cmake --install "$BUILD_DIR" --config "$BUILDTYPE"
echo "::endgroup::" echo "::endgroup::"
fi fi
# Package # Package
if [[ $MAKE_PACKAGE ]]; then if [[ $MAKE_PACKAGE ]]; then
echo "::group::Create package" echo "::group::Create package"
cmake --build . --target package --config "$BUILDTYPE" cpack --version
cmake --build "$BUILD_DIR" --target package --config "$BUILDTYPE"
echo "::endgroup::" echo "::endgroup::"
if [[ $PACKAGE_SUFFIX ]]; then if [[ $PACKAGE_SUFFIX ]]; then
echo "::group::Update package name" echo "::group::Update package name"
cd ..
BUILD_DIR="$BUILD_DIR" .ci/name_build.sh "$PACKAGE_SUFFIX" BUILD_DIR="$BUILD_DIR" .ci/name_build.sh "$PACKAGE_SUFFIX"
echo "::endgroup::" echo "::endgroup::"
fi fi