From bbdbe710c5ad26ada6ae2034c8b00b0e3e0475c9 Mon Sep 17 00:00:00 2001 From: David Sisson Date: Mon, 10 Jul 2023 11:23:23 -0700 Subject: [PATCH] Improved variables names to make it more obvious what's going on. --- CMakeLists.txt | 7 +++---- third_party/CMakeLists.txt | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 047b0ec3..9127cd0d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,12 +26,11 @@ add_subdirectory(third_party) # available otherwise we fallback to the older protobuf method. TODO: Simplify # once we can require cmake 3.27 (where CONFIG is default). find_package(Protobuf QUIET CONFIG) -if(${Protobuf_FOUND}) - set(PROTOBUF_LOADED_AS_CONFIG ON) -else() +set(ABSL_INCLUDED_WITH_PROTOBUF ON) +if(NOT ${Protobuf_FOUND}) find_package(Protobuf REQUIRED) include_directories(${Protobuf_INCLUDE_DIRS}) - set(PROTOBUF_LOADED_AS_CONFIG OFF) + set(ABSL_INCLUDED_WITH_PROTOBUF OFF) endif() list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules") diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index f1b01cc0..7b8d8e60 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 -if(NOT ${PROTOBUF_LOADED_AS_CONFIG}) +if(NOT ${ABSL_INCLUDED_WITH_PROTOBUF}) set(ABSL_PROPAGATE_CXX_STD ON) add_subdirectory(abseil-cpp) endif()