Re: [CMake] Testing an exe with gtest - possible?

2019-11-23 Thread cen
Thanks, this pointed me in the right direction. I ended up moving main() to it's own file so nothing depends on it, using a static add_library (project sources minus the main.cpp) and depend on that target from gtest exe project. Works like a charm. I missed the discourse announcement, I'll

Re: [CMake] Testing an exe with gtest - possible?

2019-11-20 Thread Kyle Edwards via CMake
On Wed, 2019-11-20 at 00:54 +0100, cen wrote: > Hi > > I have an existing c++ exe project which I want to test with gtest. > I  > have not yet found an easy way to keep the project as is and test it  > directly since gtest insists (obviously) to link against the code > being  > tested. I found a s