Skip to content

Commit 22cc2b3

Browse files
committed
Include a shell script for rebuilding the CMake temporary files
Fixes #2
1 parent 3b71a09 commit 22cc2b3

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

cmake/reconfigure.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/sh
2+
3+
# Deletes and rebuilds the temporary CMake files
4+
5+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
6+
CMAKE_BASE_DIR="$(dirname "$DIR")"
7+
8+
if [ -f CMakeLists.txt ]
9+
then
10+
echo "Directory contains CMakeLists.txt. You should use a clean out of source build. Exiting."
11+
exit 1
12+
fi
13+
14+
if [ -f CMakeCache.txt ]
15+
then
16+
echo "Directory contains CMake files, will clean up."
17+
rm -rf bin/ CMake* cmake_install.cmake Makefile lib/ main/ src/
18+
fi
19+
20+
echo "Building CMake build system for installation to $DOOFITSYS."
21+
if [ "$1" = "debug" ]
22+
then
23+
cmake -DCMAKE_INSTALL_PREFIX=$DOOFITSYS -DCMAKE_BUILD_TYPE=Debug $CMAKE_BASE_DIR
24+
elif [ "$1" = "profiling" ]
25+
then
26+
cmake -DCMAKE_INSTALL_PREFIX=$DOOFITSYS -DCMAKE_BUILD_TYPE=Profiling $CMAKE_BASE_DIR
27+
else
28+
cmake -DCMAKE_INSTALL_PREFIX=$DOOFITSYS -DCMAKE_BUILD_TYPE=Release $CMAKE_BASE_DIR
29+
fi

0 commit comments

Comments
 (0)