generated from AfonsoCMSousa/CPP-Template
Initial commit
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
if [ -z "$1" ]; then
|
||||
echo "Error: Invalid Argument"
|
||||
echo "Usage: $0 <executable_name>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d "./build" ]; then
|
||||
echo "Creating build directory..."
|
||||
mkdir build
|
||||
fi
|
||||
|
||||
echo ">>> Building C++ Project <<<"
|
||||
cd ./build
|
||||
cmake -DOUTPUT_NAME=$1 ..
|
||||
echo ">>> Compiling... <<<"
|
||||
make
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error: Build failed"
|
||||
exit 1
|
||||
fi
|
||||
cp ./bin/$1 ../
|
||||
echo ">>> Build Complete <<<"
|
||||
echo ">>> Executable: $1 <<<"
|
||||
Reference in New Issue
Block a user