Skip to content

Commit 46a905a

Browse files
committed
Hunterfy: add HunterGate.cmake and use hunter to install fmt
1 parent 58e6890 commit 46a905a

File tree

2 files changed

+535
-1
lines changed

2 files changed

+535
-1
lines changed

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ cmake_minimum_required(VERSION 3.2)
66
#---------------------------------------------------------------------------------------
77
# Start spdlog project
88
#---------------------------------------------------------------------------------------
9+
include("cmake/HunterGate.cmake")
10+
HunterGate(
11+
URL "https://github.com/cpp-pm/hunter/archive/v0.23.240.tar.gz"
12+
SHA1 "ca19f3769e6c80cfdd19d8b12ba5102c27b074e0"
13+
)
914
include(GNUInstallDirs)
1015
include(cmake/utils.cmake)
1116
include(cmake/ide.cmake)
@@ -147,7 +152,8 @@ target_link_libraries(spdlog_header_only INTERFACE Threads::Threads)
147152
#---------------------------------------------------------------------------------------
148153
if(SPDLOG_FMT_EXTERNAL OR SPDLOG_FMT_EXTERNAL_HO)
149154
if (NOT TARGET fmt::fmt)
150-
find_package(fmt REQUIRED)
155+
hunter_add_package(fmt)
156+
find_package(fmt REQUIRED CONFIG)
151157
endif ()
152158
target_compile_definitions(spdlog PUBLIC SPDLOG_FMT_EXTERNAL)
153159
target_compile_definitions(spdlog_header_only INTERFACE SPDLOG_FMT_EXTERNAL)

0 commit comments

Comments
 (0)