Search code examples
ccmakecross-platformgoogletest

I want to integrate gtest to my c project


Hi i want to integrate gtest to my c project with is cross-platfom and uses cmake for building .

  1. gtest can run on projects that are cross-platform (linux/win/mac/android)?

  2. when adding gtest to the project , will i have to change some of my source code beside cmake files ?

  3. Any forum that i can use/help when encountering issue when integrating the gtest to my project ? and also a good documentation for integrating the gtest on a cross-platform project using cmake ?

Thanks

running ctest to run all gtest tests


Solution

    1. gtest can run on projects that are cross-platform (linux/win/mac/android)?

    Yes. See the list of supported platforms here.

    1. when adding gtest to the project , will i have to change some of my source code beside cmake files ?

    Normally, gtest does not require any changes to your source code.

    1. Any forum that i can use/help when encountering issue when integrating the gtest to my project ? and also a good documentation for integrating the gtest on a cross-platform project using cmake ?
    • There is a themed google group.
    • The easiest way to integrate gtest is to use the FetchContent CMake module. See docs.