From: Mohamad Gebai Date: Sat, 8 Sep 2018 15:45:55 +0000 (-0400) Subject: cmake: fix version matching for Findfmt X-Git-Tag: v14.0.1~315^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=872d909d22bdd7f323df62b601ac11b36b08fcff;p=ceph.git cmake: fix version matching for Findfmt Signed-off-by: Mohamad Gebai --- diff --git a/cmake/modules/Findfmt.cmake b/cmake/modules/Findfmt.cmake index 244cfe0125f7..747d924e901e 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}")