diff --git a/.github/actions/install-metal-dev-deps/action.yml b/.github/actions/install-metal-dev-deps/action.yml index 704507d3434c..dcf1588a2015 100644 --- a/.github/actions/install-metal-dev-deps/action.yml +++ b/.github/actions/install-metal-dev-deps/action.yml @@ -37,15 +37,6 @@ runs: tar -xvf doxygen-1.9.6.linux.bin.tar.gz cd doxygen-1.9.6 sudo make install - - name: Install gtest - shell: bash - run: | - curl -L "https://github.com/google/googletest/archive/refs/tags/v1.13.0.tar.gz" -o v1.13.0.tar.gz - tar -xvf v1.13.0.tar.gz - cd googletest-1.13.0 - cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON . - make - sudo make install - name: Install Clang-17 shell: bash run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 6fcf321aed17..9892da4296b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,13 +33,21 @@ CHECK_COMPILERS() # Find all required libraries to build ############################################################################################################################ include(${PROJECT_SOURCE_DIR}/cmake/CPM_boost.cmake) -find_package(GTest REQUIRED) find_package (Python3 COMPONENTS Interpreter Development) find_library(NUMA_LIBRARY NAMES numa) if (NOT NUMA_LIBRARY) message(FATAL_ERROR "NUMA library not found") endif() +CPMAddPackage( + NAME googletest + GITHUB_REPOSITORY google/googletest + GIT_TAG release-1.12.1 + VERSION 1.12.1 + OPTIONS "INSTALL_GTEST ON" "gtest_force_shared_crt ON" +) + + ############################################################################################################################ # Setting build type flags # Will default to assert build, unless CONFIG env variable is set or manually set -DCMAKE_BUILD_TYPE diff --git a/INSTALLING.md b/INSTALLING.md index 1224ad9a7738..7cd0ac78c953 100644 --- a/INSTALLING.md +++ b/INSTALLING.md @@ -128,5 +128,3 @@ sudo apt install git git-lfs cmake=3.16.3-1ubuntu1.20.04.1 pandoc libtbb-dev lib ``` 2. Download and install [Doxygen](https://www.doxygen.nl/download.html), (v1.9 or higher, but less than v1.10) - -3. Download and install [gtest](https://github.com/google/googletest) from source (v1.13) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4d7ed51a4618..03ab524ab4ab 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,6 +1,7 @@ +enable_testing() add_library(test_common_libs INTERFACE) -target_link_libraries(test_common_libs INTERFACE pthread stdc++fs GTest::GTest GTest::Main) +target_link_libraries(test_common_libs INTERFACE pthread stdc++fs gtest gtest_main) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tt_metal/tt_metal) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tt_eager)