From 496d8c8b77fbfafd0ccf56a5d4a502e412070627 Mon Sep 17 00:00:00 2001 From: Taylor Braun-Jones Date: Mon, 23 Mar 2020 17:44:27 -0400 Subject: [PATCH] Respect the conventional BUILD_TESTS CMake option on the first configure --- build/cmake/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/build/cmake/CMakeLists.txt b/build/cmake/CMakeLists.txt index be5ce1518..70e8c0609 100644 --- a/build/cmake/CMakeLists.txt +++ b/build/cmake/CMakeLists.txt @@ -103,7 +103,14 @@ endif () option(ZSTD_BUILD_PROGRAMS "BUILD PROGRAMS" ON) option(ZSTD_BUILD_CONTRIB "BUILD CONTRIB" OFF) -option(ZSTD_BUILD_TESTS "BUILD TESTS" OFF) + +# Respect the conventional CMake option for enabling tests if it was specified on the first configure +if (BUILD_TESTING) + set(ZSTD_BUILD_TESTS_default ON) +else() + set(ZSTD_BUILD_TESTS_default OFF) +endif() +option(ZSTD_BUILD_TESTS "BUILD TESTS" ${ZSTD_BUILD_TESTS_default}) if (MSVC) option(ZSTD_USE_STATIC_RUNTIME "LINK TO STATIC RUN-TIME LIBRARIES" OFF) endif ()