Like it says in the title… the main difference I’m aware of is that include(CTest)
has extra features for integrating with CDash and defines the BUILD_TESTING
option.
But should one be preferred over the other for new code?
Like it says in the title… the main difference I’m aware of is that include(CTest)
has extra features for integrating with CDash and defines the BUILD_TESTING
option.
But should one be preferred over the other for new code?
include(CTest)
adds a bunch of targets that can be used to run parts of a dashboard submission. If you don’t need those, enable_testing()
may be preferable to avoid the extra clutter. I used to use include(CTest)
a fair bit, but these days I almost always just do enable_testing()
since I use a dedicated dashboard script if I want dashboard submissions.