diff options
author | wsnipex <wsnipex@a1.net> | 2017-03-18 18:53:02 +0100 |
---|---|---|
committer | wsnipex <wsnipex@a1.net> | 2017-03-19 09:17:44 +0100 |
commit | f6558fe3f8de7ef3947a617d3194ad7b564f1989 (patch) | |
tree | 7a5404b3de3955d4562cea7402efe4847f9f0a36 | |
parent | 19f6b582ba65592f2af39b28b67d0817824d9627 (diff) |
[cmake] require libfmt min version
-rw-r--r-- | cmake/modules/FindFmt.cmake | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/cmake/modules/FindFmt.cmake b/cmake/modules/FindFmt.cmake index 78ad7132f3..5473ed5b76 100644 --- a/cmake/modules/FindFmt.cmake +++ b/cmake/modules/FindFmt.cmake @@ -12,8 +12,18 @@ # # Fmt::Fmt - The Fmt library +if(CORE_SYSTEM_NAME STREQUAL windows OR CORE_SYSTEM_NAME STREQUAL windowsstore) + # TODO: fix windows fmt package to include fmt-config.cmake and fmt-config-version.cmake + set(FMT_VERSION 3.0.1) +else() + find_package(FMT 3.0.1 CONFIG REQUIRED QUIET) +endif() + if(PKG_CONFIG_FOUND) pkg_check_modules(PC_FMT libfmt QUIET) + if(PC_FMT_VERSION AND NOT FMT_VERSION) + set(FMT_VERSION ${PC_FMT_VERSION}) + endif() endif() find_path(FMT_INCLUDE_DIR NAMES fmt/format.h @@ -29,7 +39,8 @@ select_library_configurations(FMT) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Fmt - REQUIRED_VARS FMT_LIBRARY FMT_INCLUDE_DIR) + REQUIRED_VARS FMT_LIBRARY FMT_INCLUDE_DIR FMT_VERSION + VERSION_VAR FMT_VERSION) if(FMT_FOUND) set(FMT_LIBRARIES ${FMT_LIBRARY}) |