Relative Content

Tag Archive for c++cmakegoogletest

C++ unit tests in their own libraries – how?

I am working on a library. That library internally is broken into folders with related modules. Each folder has its own unit tests. At the root of the library I want to make a single CMakeLists.txt file that builds all the unit tests for the entire library. Ideally I dont want to directly reference every source file in the main CMakelists.txt, but instead include each of the modules tests.

Multiple definition error when running gtest with cmake

I have a problem with running gtest using cmake. This started after I changed the project structure, dividing the code into several modules with separate CMakeList.txt files. When I had one CmakeList without a static library, everything works fine.