From a574b66e99d485a74812332fe804949739ddfec0 Mon Sep 17 00:00:00 2001 From: Christian Blichmann Date: Wed, 15 Jul 2020 05:31:25 -0700 Subject: [PATCH] Do not add third_party test targets in CMake build This way, one can just run `ctest .` in the build directory and it will only run Sandboxed API and Sandbox2 tests. PiperOrigin-RevId: 321342543 Change-Id: I42537e64bfb3127dca00bd92a3f7b35ca64004d9 --- cmake/gflags/Download.cmake | 1 + cmake/glog/Download.cmake | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/cmake/gflags/Download.cmake b/cmake/gflags/Download.cmake index c7302ef..15aaf87 100644 --- a/cmake/gflags/Download.cmake +++ b/cmake/gflags/Download.cmake @@ -34,6 +34,7 @@ endif() set(GFLAGS_IS_SUBPROJECT TRUE) set(GFLAGS_INSTALL_SHARED_LIBS FALSE) +set(GFLAGS_BUILD_TESTING FALSE) add_subdirectory("${CMAKE_BINARY_DIR}/gflags-src" "${CMAKE_BINARY_DIR}/gflags-build" EXCLUDE_FROM_ALL) diff --git a/cmake/glog/Download.cmake b/cmake/glog/Download.cmake index 7574072..5bd448f 100644 --- a/cmake/glog/Download.cmake +++ b/cmake/glog/Download.cmake @@ -40,8 +40,12 @@ set(WITH_UNWIND OFF CACHE BOOL "" FORCE) set(UNWIND_LIBRARY FALSE) set(HAVE_PWD_H FALSE) +set(_glog_BUILD_TESTING ${BUILD_TESTING}) +set(BUILD_TESTING FALSE) add_subdirectory("${CMAKE_BINARY_DIR}/glog-src" "${CMAKE_BINARY_DIR}/glog-build" EXCLUDE_FROM_ALL) +set(BUILD_TESTING ${_glog_BUILD_TESTING}) +set(_glog_BUILD_TESTING) target_include_directories(glog PUBLIC $ )