Удаление только каталога для заданного варианта сборки
This commit is contained in:
parent
e15e1fb505
commit
36487b07d2
21
cmake.sh
21
cmake.sh
@ -94,15 +94,6 @@ CMAKE_ARGS=()
|
||||
|
||||
[ ! -f "${SOURCE_DIR}/CMakeLists.txt" ] && { echo "Source directory does not contain CMakeLists.txt"; exit 4; }
|
||||
|
||||
if [ -d "${BUILD_DIR}" ]; then
|
||||
if [ "x${FORCE}" == "xy" ]; then
|
||||
rm -rf "${BUILD_DIR}"
|
||||
else
|
||||
echo "Build directory already exists. Use --force to remove this directory or do it manually"
|
||||
exit 5
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "x${SINGLE_TYPE}" != "xn" ]; then
|
||||
case "${SINGLE_TYPE}" in
|
||||
None|Debug|Release|Profile|RelWithDebInfo|MinSizeRel)
|
||||
@ -123,6 +114,7 @@ export BUILD_DIR
|
||||
export OUTPUT_DIR
|
||||
export CMAKE_ARGS
|
||||
export SINGLE_TYPE
|
||||
export FORCE
|
||||
|
||||
CMAKE_BUILD_TYPES=(None Debug Release Profile RelWithDebInfo MinSizeRel)
|
||||
QTCREATOR_BUILD_TYPES=(qtNone qtDebug qtRelease qtProfile)
|
||||
@ -158,7 +150,16 @@ generate_configuration() {
|
||||
else
|
||||
GEN_DIR="${BUILD_DIR}/${SINGLE_TYPE}"
|
||||
fi
|
||||
[ -d "${GEN_DIR}" ] && return 0
|
||||
|
||||
if [ -d "${GEN_DIR}" ]; then
|
||||
if [ "x${FORCE}" == "xy" ]; then
|
||||
rm -rf "${GEN_DIR}"
|
||||
else
|
||||
echo "Build directory '${GEN_DIR}' already exists. Use --force to remove this directory or do it manually"
|
||||
return
|
||||
fi
|
||||
fi
|
||||
|
||||
mkdir -p "${GEN_DIR}"
|
||||
pushd "${GEN_DIR}" 2>/dev/null
|
||||
cmake -G "${GENERATOR}" -DCMAKE_INSTALL_PREFIX="${OUTPUT_DIR}" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" "${CMAKE_ARGS[@]}" "${SOURCE_DIR}"
|
||||
|
Loading…
Reference in New Issue
Block a user