Add BUILD_TESTING to standard CMake arguments#30374
Add BUILD_TESTING to standard CMake arguments#30374chuckatkins merged 1 commit intospack:developfrom
Conversation
CTest determines whether to enable tests using the BUILD_TESTING variable. This should be used by projects to conditionally enable the compilation of tests. Spack knowns which packages have to run tests and can thus automatically define this variable.
I think many packages already implement this in their |
except it does: Maybe it's better to leave it to the package to decide? There's probably more cmake packages that expect |
You are right, this is the default of this option. Always expecting the default behaviour of a user-definable option (without asserting it), however, is a bug in the build system of the software. Using We weren't aware of |
CTest determines whether to enable tests using the
BUILD_TESTINGvariable.This should be used by projects to conditionally enable the compilation of tests.
Spack knowns which packages are requested to run tests and can thus automatically define this variable for CMake packages.
This addition should
BUILD_TESTING.