diff --git a/tests/cpp/CMakeLists.txt b/tests/cpp/CMakeLists.txt index 65b71f4e..6bd92f5d 100644 --- a/tests/cpp/CMakeLists.txt +++ b/tests/cpp/CMakeLists.txt @@ -1,6 +1,12 @@ # Google Test -find_package(GTest REQUIRED) -include_directories(${GTEST_INCLUDE_DIRS}) +include(FetchContent) +FetchContent_Declare( + googletest + URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip +) +# For Windows: Prevent overriding the parent project's compiler/linker settings +set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) +FetchContent_MakeAvailable(googletest) find_package(CUDAToolkit REQUIRED) @@ -20,16 +26,15 @@ message(STATUS "CUDA is available in tests") message(STATUS "CUDa toolkit libraries: ${CUDAToolkit_LIBRARY_DIR}") target_link_libraries( test_ipc PRIVATE - GTest::GTest - GTest::Main Python3::Python + GTest::gtest_main CUDA::cudart CUDA::cudart_static craftground ) target_compile_options(test_ipc PRIVATE -D_GLIBCXX_USE_CXX11_ABI=1) - # Integrate with CTest -add_test(NAME CppTests COMMAND test_ipc) +include(GoogleTest) +gtest_discover_tests(test_ipc)