]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: fix version matching for Findfmt 23996/head
authorMohamad Gebai <mgebai@suse.com>
Sat, 8 Sep 2018 15:45:55 +0000 (11:45 -0400)
committerMohamad Gebai <mgebai@suse.com>
Mon, 10 Sep 2018 14:22:24 +0000 (10:22 -0400)
Signed-off-by: Mohamad Gebai <mgebai@suse.com>
cmake/modules/Findfmt.cmake

index 244cfe0125f79593e6a59afad787270585c572dc..747d924e901e7681678a353acdbfb257fa53c0ca 100644 (file)
@@ -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}")