From 54e032339faa3c6f53681679e6e2e1d027869366 Mon Sep 17 00:00:00 2001 From: Ruslan Baratov Date: Sat, 2 Nov 2019 01:04:54 +0300 Subject: [PATCH] Use Hunter to install fmt --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 12320fbf4..74b659836 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,11 @@ cmake_minimum_required(VERSION 3.2) #--------------------------------------------------------------------------------------- # Start spdlog project #--------------------------------------------------------------------------------------- +include("cmake/HunterGate.cmake") +HunterGate( + URL "https://github.com/ruslo/hunter/archive/v0.20.64.tar.gz" + SHA1 "7b830dfda7a094b2af15f44b24ebd2489404d880" +) include(GNUInstallDirs) include(cmake/utils.cmake) include(cmake/ide.cmake) @@ -125,7 +130,8 @@ target_link_libraries(spdlog_header_only INTERFACE Threads::Threads) #--------------------------------------------------------------------------------------- if(SPDLOG_FMT_EXTERNAL) if (NOT TARGET fmt::fmt) - find_package(fmt REQUIRED) + hunter_add_package(fmt) + find_package(fmt REQUIRED CONFIG) endif () target_compile_definitions(spdlog PUBLIC SPDLOG_FMT_EXTERNAL) target_link_libraries(spdlog PUBLIC fmt::fmt) @@ -231,4 +237,3 @@ if (SPDLOG_INSTALL) include(cmake/spdlogCPack.cmake) endif () -