From 454f01def31b7f6e6207d764d9a3eebe1769b488 Mon Sep 17 00:00:00 2001 From: Inna Date: Sun, 29 Oct 2023 21:47:09 +0300 Subject: [PATCH] Modified prereqs.sh --- src/prereqs.sh | 77 +++++++++++++++++++++++++++----------------------- 1 file changed, 42 insertions(+), 35 deletions(-) diff --git a/src/prereqs.sh b/src/prereqs.sh index 236da6f..1d27f0e 100755 --- a/src/prereqs.sh +++ b/src/prereqs.sh @@ -1,47 +1,54 @@ #!/bin/bash # Update the package list -apt-get update +apt update +apt -y install make cmake git clang gcc # Make a dir for gtest installation mkdir /home/googletest -mkdir /home/googletest/googletest mkdir /home/googletest/googletest_build -cd /home/googletest/googletest_build -# Install the libgtest-dev package -apt-get install libgtest-dev -y - -sudo apt-get install check - -# Navigate to the gtest source directory -cd /usr/src/googletest/googletest +cd /home/googletest +git clone https://github.com/google/googletest -# Create a build directory and navigate to it -mkdir build -cd build - -# Run CMake to configure the build -cmake .. - -# Build the Google Test library +cd googletest_build +cmake -DCMAKE_INSTALL_PREFIX:PATH=/home/googletest ../googletest make +make install -# Copy the generated library files to /usr/lib/ -cp libgtest* /usr/lib/ - -# Return to the parent directory -cd .. - -# Remove the build directory -rm -rf build - -# Create the /usr/local/lib/googletest directory -mkdir /usr/local/lib/googletest - -# Create symbolic links for libgtest.a and libgtest_main.a in /usr/local/lib/googletest -ln -s /usr/lib/libgtest.a /usr/local/lib/googletest/libgtest.a -ln -s /usr/lib/libgtest_main.a /usr/local/lib/googletest/libgtest_main.a - -# Print a message to indicate that the setup is complete +# Install the libgtest-dev package +#apt-get install libgtest-dev -y +# +#sudo apt-get install check +# +## Navigate to the gtest source directory +#cd /usr/src/googletest/googletest +# +## Create a build directory and navigate to it +#mkdir build +#cd build +# +## Run CMake to configure the build +#cmake .. +# +## Build the Google Test library +#make +# +## Copy the generated library files to /usr/lib/ +#cp libgtest* /usr/lib/ +# +## Return to the parent directory +#cd .. +# +## Remove the build directory +#rm -rf build +# +## Create the /usr/local/lib/googletest directory +#mkdir /usr/local/lib/googletest +# +## Create symbolic links for libgtest.a and libgtest_main.a in /usr/local/lib/googletest +#ln -s /usr/lib/libgtest.a /usr/local/lib/googletest/libgtest.a +#ln -s /usr/lib/libgtest_main.a /usr/local/lib/googletest/libgtest_main.a +# +## Print a message to indicate that the setup is complete echo "Google Test (gtest) setup is complete."