Hi,

I'm trying to build a collection of libraries, each with a
set of unit tests. In CMakeLists.txt, I use `add_library` to create the main target and `add_executable` to generate a test runner for each library. Then I use `target_link_libraries` to link each test runner to it's corresponding library.

The problem with this solution is that I can only test the interfaces that are exported from the library. I really want to be able to test all of the units, including internal classes. But how can I do this with CMake?

In the past (when I was using SCons) I compiled the source files into object files, and then linked the same object files into both the test executable and the shared library. Is it possible to do this with CMake?

Many thanks,
Marcus

_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to