Add BUILD_TESTING to standard CMake arguments (#30374)
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.
This commit is contained in:
parent
cf905ec14a
commit
1006dd54de
1 changed files with 2 additions and 0 deletions
|
@ -176,6 +176,7 @@ def _std_args(pkg):
|
||||||
'-G', generator,
|
'-G', generator,
|
||||||
define('CMAKE_INSTALL_PREFIX', convert_to_posix_path(pkg.prefix)),
|
define('CMAKE_INSTALL_PREFIX', convert_to_posix_path(pkg.prefix)),
|
||||||
define('CMAKE_BUILD_TYPE', build_type),
|
define('CMAKE_BUILD_TYPE', build_type),
|
||||||
|
define('BUILD_TESTING', pkg.run_tests),
|
||||||
]
|
]
|
||||||
|
|
||||||
# CMAKE_INTERPROCEDURAL_OPTIMIZATION only exists for CMake >= 3.9
|
# CMAKE_INTERPROCEDURAL_OPTIMIZATION only exists for CMake >= 3.9
|
||||||
|
@ -361,6 +362,7 @@ def cmake_args(self):
|
||||||
|
|
||||||
* CMAKE_INSTALL_PREFIX
|
* CMAKE_INSTALL_PREFIX
|
||||||
* CMAKE_BUILD_TYPE
|
* CMAKE_BUILD_TYPE
|
||||||
|
* BUILD_TESTING
|
||||||
|
|
||||||
which will be set automatically.
|
which will be set automatically.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue