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()