It's a well known problem that executing make "test" doesn't build the tests as discussed here. As suggested, the problem can be partly solved with the artificial target "check". I want to know how I can force building of tests when i call "make Nightly".
What I've done so far:
add_custom_target(buildtests)
add_custom_target(check COMMAND "ctest")
add_dependencies(check buildtests)
add_dependencies(Nightly buildtests)
add_dependencies(buildtests Test1)
...
add_dependencies(buildtests TestN)
Now "make check" builds an runs the tests, but "make Nightly"
- builds the tests
- updates the repo to CTEST_NIGHTLY_START_TIME
- builds all other targets
- runs the (now outdated) tests