From: Taylor Braun-Jones Date: Mon, 23 Mar 2020 21:44:27 +0000 (-0400) Subject: Respect the conventional BUILD_TESTS CMake option on the first configure X-Git-Tag: v1.4.5^2~57^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=496d8c8b77fbfafd0ccf56a5d4a502e412070627;p=thirdparty%2Fzstd.git Respect the conventional BUILD_TESTS CMake option on the first configure --- 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 ()