Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update install build tools to manually install both #29

Merged
merged 4 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmake/Testing.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ IF(NOT DEFINED ENV{BUILD_ARCHITECTURE} AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/te
target_link_libraries(${UNIT_TEST} PUBLIC
${PROJECT_NAME}
${TEST_LINK_LIBRARIES}
GTest::gtest_main)
GTest::gtest_main
GTest::gmock_main)
add_test(NAME ${UNIT_TEST} COMMAND ${UNIT_TEST})
include(GoogleTest)
gtest_discover_tests(${UNIT_TEST})
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ if [ $GENERATE_COVERAGE -eq 1 ]; then
COVERAGE_FLAGS=-DGENERATE_COVERAGE=True
fi

cmake -B${BUILD_DIR} ${TOOLCHAIN_ARG} -DCMAKE_CXX_FLAGS="${CXXFLAGS}" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" ${PACKAGE_VERSION_SUFFIX} ${COVERAGE_FLAGS}
cmake -B${BUILD_DIR} ${TOOLCHAIN_ARG} -DCMAKE_CXX_FLAGS="${CXXFLAGS}" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" ${PACKAGE_VERSION_SUFFIX} ${COVERAGE_FLAGS} .
cd ${BUILD_DIR}
cmake --build .
if [ $GENERATE_DEBIAN_PACKAGE -eq 1 ]; then
Expand Down
51 changes: 30 additions & 21 deletions scripts/install_build_tools.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
#!/bin/bash
set -e
# shellcheck source=/dev/null
. /etc/lsb-release
echo "Distribution code name : ${DISTRIB_CODENAME}"
apt-get update
if [ "$DISTRIB_CODENAME" = "bionic" ];then
echo "Installing bionic build tools ..."
DEPENDENCIES=(
build-essential
cmake
googletest
google-mock
gdb
git)
else
echo "Installing other linux distribution (focal or jammy) build tools ..."
DEPENDENCIES=(
apt-get -y install
DEPENDENCIES=(
wget
ca-certificates
build-essential
cmake
build-essential
libgtest-dev
libgmock-dev
gdb
git)
fi
DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends --yes --quiet "${DEPENDENCIES[@]}"
DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends --yes --quiet "${DEPENDENCIES[@]}"
cd /tmp
# Installing CMake
paulbourelly999 marked this conversation as resolved.
Show resolved Hide resolved
CMAKE_VERSION="3.27.7"
echo "Installing CMake ${CMAKE_VERSION}"
wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.sh
wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz
chmod u+x cmake-${CMAKE_VERSION}-linux-x86_64.sh
./cmake-${CMAKE_VERSION}-linux-x86_64.sh --skip-license --include-subdir --prefix=/opt
rm cmake-${CMAKE_VERSION}-linux-x86_64.sh
rm cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz
echo "export PATH=/opt/cmake-${CMAKE_VERSION}-linux-x86_64/bin:$PATH" >> /etc/bash.bashrc
# shellcheck source=/dev/null
export PATH=/opt/cmake-${CMAKE_VERSION}-linux-x86_64/bin:$PATH
echo "CMake installation complete"
# Installing Google Test
GTEST_VERSION="1.14.0"
echo "Installing Google Test ${GTEST_VERSION}"
git clone https://github.com/google/googletest.git -b "v${GTEST_VERSION}"
cd googletest/
cmake -Bbuild
cmake --build build
cmake --install build
echo "Google Test installation complete"
paulbourelly999 marked this conversation as resolved.
Show resolved Hide resolved
cd ..
rm -r googletest/