summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-10-24 16:01:36 (GMT)
committerBrad King <brad.king@kitware.com>2018-10-24 19:51:17 (GMT)
commita834bcaa9100f552b7f40e2f439fe3afc972e2f1 (patch)
treeeb7d39ef613cff7bca07945172719ce701a8ac91 /CMakeLists.txt
parentec13ba36b5398f1d561d6e72d8e253d0eb3c2b5e (diff)
downloadCMake-a834bcaa9100f552b7f40e2f439fe3afc972e2f1.zip
CMake-a834bcaa9100f552b7f40e2f439fe3afc972e2f1.tar.gz
CMake-a834bcaa9100f552b7f40e2f439fe3afc972e2f1.tar.bz2
Tests: Add missing BUILD_TESTING conditions
We should not call `add_test` unless `BUILD_TESTING` is enabled. Fixes: #18500
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt7
1 files changed, 4 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 20ee36c..998db15 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -791,9 +791,10 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
endif()
endif()
-# add a test
-add_test(SystemInformationNew "${CMAKE_CMAKE_COMMAND}"
- --system-information -G "${CMAKE_GENERATOR}" )
+if(BUILD_TESTING)
+ add_test(SystemInformationNew "${CMAKE_CMAKE_COMMAND}"
+ --system-information -G "${CMAKE_GENERATOR}" )
+endif()
if(NOT CMake_TEST_EXTERNAL_CMAKE)
# Install license file as it requires.