2017-09-22 19:46:06 +08:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
2023-10-17 06:04:08 +08:00
|
|
|
SUPPORTED_BUILD_TYPES=(
|
|
|
|
Debug
|
|
|
|
Release
|
|
|
|
RelWithDebInfo
|
|
|
|
)
|
|
|
|
|
|
|
|
# Check if the script has one argument initialize build_type with it, otherwise set default value "release"
|
|
|
|
if [[ "$#" -eq 1 ]]; then
|
|
|
|
build_type="$1"
|
|
|
|
else
|
|
|
|
build_type="Release"
|
|
|
|
fi
|
|
|
|
|
|
|
|
is_build_type_ok=false
|
|
|
|
for supported_build_type in "${SUPPORTED_BUILD_TYPES[@]}"; do
|
|
|
|
if [[ "$supported_build_type" == "${build_type}" ]]; then
|
|
|
|
is_build_type_ok=true
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if [[ "$is_build_type_ok" == false ]]; then
|
|
|
|
echo "Unsupported build type: $build_type"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2017-09-22 19:46:06 +08:00
|
|
|
# Builds the memgraph tools and installs them in this directory.
|
|
|
|
|
|
|
|
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
|
|
|
|
mkdir -p ${script_dir}/build
|
|
|
|
cd ${script_dir}/build
|
|
|
|
|
|
|
|
# Setup cmake
|
2023-10-17 06:04:08 +08:00
|
|
|
cmake -DCMAKE_BUILD_TYPE=$build_type \
|
2017-12-04 20:56:17 +08:00
|
|
|
-DTOOLS=ON \
|
2017-09-22 19:46:06 +08:00
|
|
|
-DCMAKE_INSTALL_PREFIX=${script_dir} \
|
2017-12-04 20:56:17 +08:00
|
|
|
${script_dir}/..
|
2017-09-22 19:46:06 +08:00
|
|
|
|
|
|
|
# Install the tools
|
2017-12-04 20:56:17 +08:00
|
|
|
make -j$(nproc) tools
|
|
|
|
cmake -DCOMPONENT=tools -P cmake_install.cmake
|
|
|
|
cd ${script_dir}
|
|
|
|
mv bin/* ./
|
|
|
|
rm -rf bin build
|