diff --git a/cmake/googletest.cmake b/cmake/googletest.cmake index 1a971fe..40d9a4a 100644 --- a/cmake/googletest.cmake +++ b/cmake/googletest.cmake @@ -1,18 +1,17 @@ include_guard() -CPMAddPackage( - NAME googletest - GITHUB_REPOSITORY google/googletest - GIT_TAG v1.13.0 - VERSION 1.13.0 - OPTIONS - "INSTALL_GTEST OFF" - "gtest_force_shared_crt ON" +include(FetchContent) +FetchContent_Declare( + googletest + GIT_REPOSITORY https://github.com/google/googletest.git + GIT_TAG 58d77fa8070e8cec2dc1ed015d66b454c8d78850 # release-1.12.1 ) - +# For Windows: Prevent overriding the parent project's compiler/linker settings +set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) +FetchContent_MakeAvailable(googletest) set_property(TARGET gtest gtest_main gmock gmock_main - PROPERTY FOLDER third_party/GoogleTest) + PROPERTY FOLDER third_party/GoogleTest) \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 28d95e4..4cae0ed 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,6 +3,5 @@ auto main() -> int { fmt::print("Hello, World!"); - return 0; }