From 487ce37fa775d57e1403c40eec7b69d0d91d7f2c Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Mon, 9 Sep 2024 13:39:59 +0200 Subject: [PATCH] Allow system/local Abseil master Add special handling when `absl_VERSION` is empty. This is the case when the `master` branch of `abseil-cpp` was installed using `CMake`. In that case check for VLOG availability through the CMake target `absl::absl_vlog_is_on`. Fixes: https://github.com/ceres-solver/ceres-solver/issues/1098 Change-Id: I3367aeb65caceb11558d8d6265dafe3ecc9a4875 --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 60f8f755b..c02cb9cf8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -157,8 +157,12 @@ else() # For some reason unknown to me having the version number in the # find_package call fails. So we check for he minimum version # manually. - if (absl_VERSION VERSION_LESS 20240116) - message(FATAL_ERROR "The version of abseil installed on the system is " ${absl_VERSION} " need at least 20240116") + if ("${absl_VERSION}" STREQUAL "") + if (NOT TARGET absl::absl_vlog_is_on) + message(FATAL_ERROR "The version of abseil installed on the system provides no version info and is missing TARGET 'absl::absl_vlog_is_on', need at least 20240116.0") + endif() + elseif (absl_VERSION VERSION_LESS 20240116) + message(FATAL_ERROR "The version of abseil installed on the system is '${absl_VERSION}' need at least 20240116") endif() endif()