17 Sep
2018
17 Sep
'18
12:19 p.m.
Alexander Grund wrote:
Usual action for this is to only add the tests folder if CMAKE_SOURCE_DIR==PROJECT_SOURCE_DIR (you are the project being build)
This sounds sensible.
The two options I see for running the tests are 1. Use test/CMakeLists.txt as the root list file, put inside # our own library add_subdirectory(..) # test dependencies add_subdirectory(../../assert) add_subdirectory(../../core) enable_testing() and proceed with declaring the tests. 2. Use CMakeLists.txt as the root list file, check as suggested above that we're the root project, and if so, add_subdirectory(../assert) add_subdirectory(../core) add_subdirectory(test)