From 96ca9fd8eeb9ec8b9dfd34ad29288ed943a69651 Mon Sep 17 00:00:00 2001 From: David Sisson Date: Mon, 10 Jul 2023 12:00:35 -0700 Subject: [PATCH] Updated. --- CMakeLists.txt | 10 ++++++---- third_party/CMakeLists.txt | 4 +++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9127cd0d..42ad3892 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,12 +22,14 @@ include_directories(src) add_subdirectory(third_party) +# TODO: Simplify once we can require cmake 3.27 (where CONFIG is default). + # Due to packaging changes we use the combined protobuf/absl packaging if -# available otherwise we fallback to the older protobuf method. TODO: Simplify -# once we can require cmake 3.27 (where CONFIG is default). +# available otherwise we fallback to the older protobuf method. find_package(Protobuf QUIET CONFIG) -set(ABSL_INCLUDED_WITH_PROTOBUF ON) -if(NOT ${Protobuf_FOUND}) +if(${Protobuf_FOUND}) + set(ABSL_INCLUDED_WITH_PROTOBUF ON) +else() find_package(Protobuf REQUIRED) include_directories(${Protobuf_INCLUDE_DIRS}) set(ABSL_INCLUDED_WITH_PROTOBUF OFF) diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index 7b8d8e60..dfb1bc02 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -1,6 +1,8 @@ # SPDX-License-Identifier: Apache-2.0 -if(NOT ${ABSL_INCLUDED_WITH_PROTOBUF}) +if(${ABSL_INCLUDED_WITH_PROTOBUF}) + # Remove abseil-cpp from the repo when we can require cmake 3.27. +else() set(ABSL_PROPAGATE_CXX_STD ON) add_subdirectory(abseil-cpp) endif()