From 63463eee711fd2af27899151987c8a5d2fdbbbb5 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 25 Jul 2021 14:43:27 +0200 Subject: [PATCH] Set BUILD_TESTIN to OFF by default when building cpu_features --- .../libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt | 7 ------- .../volk_gnsssdr/cpu_features/CMakeLists.txt | 3 +++ .../volk_gnsssdr/cpu_features/cmake/README.md | 6 +++--- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt index 65fa128f1..54dcf88cc 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt @@ -277,14 +277,7 @@ if(CMAKE_VERSION VERSION_GREATER 3.0 AND SUPPORTED_CPU_FEATURES_ARCH) if(CpuFeatures_FOUND) message(STATUS "Found CpuFeatures: (found version ${CpuFeatures_VERSION})") else() - if(BUILD_TESTING) - set(BUILD_TESTING_AUX ${BUILD_TESTING}) - endif() - set(BUILD_TESTING OFF) add_subdirectory(cpu_features) - if(BUILD_TESTING_AUX) - set(BUILD_TESTING ${BUILD_TESTING_AUX}) - endif() endif() set(BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS_SAVED}") endif() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/CMakeLists.txt index 30c8f27b0..2feca7715 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/CMakeLists.txt @@ -23,6 +23,9 @@ if(NOT CMAKE_BUILD_TYPE) FORCE) endif() +# BUILD_TESTING is a standard CMake variable, but we declare it here to make it +# prominent in the GUI. +option(BUILD_TESTING "Enable test (depends on googletest)." OFF) # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to make # it prominent in the GUI. # cpu_features uses bit-fields which are - to some extends - implementation-defined (see https://en.cppreference.com/w/c/language/bit_field). diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/cmake/README.md b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/cmake/README.md index 23b205ec1..51efb42b7 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/cmake/README.md +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/cmake/README.md @@ -29,10 +29,10 @@ cpu_features directly and use the `cpu_features` target in your project. 3- Add the `cpu_features` target to the `target_link_libraries()` section of your executable or of your library. -## Disabling tests +## Enabling tests -CMake default options for cpu_features is Release built type with tests enabled. -To disable testing set cmake `BUILD_TESTING` variable to `OFF`, +CMake default options for cpu_features is Release built type with tests +disabled. To enable testing set cmake `BUILD_TESTING` variable to `ON`, [.travis.yml](https://github.com/google/cpu_features/blob/master/.travis.yml) and [appveyor.yml](https://github.com/google/cpu_features/blob/master/appveyor.yml)