From 0bcef3a210dd1083b744884b21f4cee923d9018c Mon Sep 17 00:00:00 2001 From: Dark Dragon Date: Sun, 23 Apr 2023 18:14:16 +0200 Subject: [PATCH] Use find_package(absl CONFIG) Same approach as in Protobuf: https://github.com/protocolbuffers/protobuf/blob/bc127f2b5605e5454d1c15d3325ecdd5ceaad6cf/cmake/abseil-cpp.cmake#L36 --- cpp/CMakeLists.txt | 3 ++- cpp/cmake/config.cmake.in | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index cdd7a0813..bc481ea21 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -106,7 +106,8 @@ if (USE_ALTERNATE_FORMATS) endif () # Find all the required libraries and programs. -find_package(absl) +# Use "CONFIG" as there is no built-in cmake module for absl. +find_package(absl CONFIG REQUIRED) if(NOT absl_FOUND) # Overide abseil install rules for subprojects diff --git a/cpp/cmake/config.cmake.in b/cpp/cmake/config.cmake.in index 05f915659..2cf7fc9bb 100644 --- a/cpp/cmake/config.cmake.in +++ b/cpp/cmake/config.cmake.in @@ -2,7 +2,7 @@ include(CMakeFindDependencyMacro) -find_dependency(absl) +find_dependency(absl CONFIG) find_dependency(Protobuf) include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake")