16 Sep
2018
16 Sep
'18
6:12 p.m.
Could you elaborate, why this would require separate/conflicting cmake files as opposed to having multiple different targets in a single file?
If I include your project's root CMake file that contains tests added by add_test(), then I cannot avoid those when running my own tests.
The way I've solved this in my cmake is to detect if the project is the root project or not. So if the base CMakeLists.txt in the build is mine, I compile in tests etc. If it is not, I assume I am being included as a dependency, and leave out lots of stuff. Niall