Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
Georgyshul committed Oct 29, 2023
2 parents 955d723 + 454f01d commit ed1dfb7
Showing 1 changed file with 42 additions and 35 deletions.
77 changes: 42 additions & 35 deletions src/prereqs.sh
Original file line number Diff line number Diff line change
@@ -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."

0 comments on commit ed1dfb7

Please sign in to comment.