Issues setting up Gtest using cmake

This page summarizes the projects mentioned and recommended in the original post on /r/cpp_questions

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • Google Test

    GoogleTest - Google Testing and Mocking Framework

  • include(FetchContent) FetchContent_Declare( googletest GIT_REPOSITORY https://github.com/google/googletest.git GIT_TAG release-1.12.1 ) add_executable(tests main_tests.cpp) target_link_libraries(tests GTest::gtest_main) include(GoogleTest) gtest_discover_tests(tests)

  • cmake-init

    The missing CMake project initializer

  • Grab cmake-init, generate an executable project with one of the above package managers. The default testing library is Catch2, but based on the existing code you can change it to GTest instead.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts