-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathclean-cmake.sh
More file actions
29 lines (24 loc) · 856 Bytes
/
clean-cmake.sh
File metadata and controls
29 lines (24 loc) · 856 Bytes
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
# Copyright 2019-present, Joseph Garnier
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
# =============================================================================
# What Is This?
# -------------
# See README file in the root directory of this source tree.
#!/bin/bash
readonly WORKSPACE_DIR=$(pwd)
declare -r BUILD_DIR="${WORKSPACE_DIR}/build/x64-Release-Win-GCC"
declare -r SOLUTION_DIR="${WORKSPACE_DIR}/build"
if [[ -d "${SOLUTION_DIR}" ]]; then
cmake --build "${BUILD_DIR}" --target clean
# Remove solution in build directory, excepted gitignore file.
shopt -s extglob
eval "rm -rf \"${SOLUTION_DIR}\"/{,..?,.[!(.|gitignore)]}*"
shopt -u extglob
fi
if [[ "${?}" -eq 0 ]]; then
echo "The solution was successfully cleaned!"
fi
exit $?