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
This commit is contained in:
Reinhold Gschweicher
2024-09-09 13:39:59 +02:00
parent 6aa7df9650
commit 487ce37fa7
+6 -2
View File
@@ -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()