From 872d909d22bdd7f323df62b601ac11b36b08fcff Mon Sep 17 00:00:00 2001 From: Mohamad Gebai Date: Sat, 8 Sep 2018 11:45:55 -0400 Subject: [PATCH] cmake: fix version matching for Findfmt Signed-off-by: Mohamad Gebai --- cmake/modules/Findfmt.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/modules/Findfmt.cmake b/cmake/modules/Findfmt.cmake index 244cfe0125f..747d924e901 100644 --- a/cmake/modules/Findfmt.cmake +++ b/cmake/modules/Findfmt.cmake @@ -1,13 +1,13 @@ find_path(fmt_INCLUDE_DIR NAMES fmt/format.h) if(fmt_INCLUDE_DIR) - set(_fmt_version_file "${fmt_INCLUDE_DIR}/fmt/format.h") + set(_fmt_version_file "${fmt_INCLUDE_DIR}/fmt/core.h") if(NOT EXISTS "${_fmt_version_file}") - set(_fmt_version_file "${fmt_INCLUDE_DIR}/fmt/core.h") + set(_fmt_version_file "${fmt_INCLUDE_DIR}/fmt/format.h") endif() if(EXISTS "${_fmt_version_file}") # parse "#define FMT_VERSION 40100" to 4.1.0 - file(STRINGS "${fmt_INCLUDE_DIR}/fmt/format.h" fmt_VERSION_LINE + file(STRINGS "${_fmt_version_file}" fmt_VERSION_LINE REGEX "^#define[ \t]+FMT_VERSION[ \t]+[0-9]+$") string(REGEX REPLACE "^#define[ \t]+FMT_VERSION[ \t]+([0-9]+)$" "\\1" fmt_VERSION "${fmt_VERSION_LINE}") -- 2.39.5