I want a cmake project with two configurations BUILD and TEST.
BUILD compiles all sources not in test subdirectory into a shared library. TEST compiles all sources, including those in test subdirectory (which includes main.cpp) into an executable that runs the tests. I don't want TEST to build the shared library. I don't want BUILD to build the test executable.
I currently have it on disk as:
project/ test/ test_foo.cpp main.cpp bar.hpp widget.hpp bar.cpp widget.cpp ... I can move things around if it makes it easier. What do I put in my CMakeLists.txt files?