aboutsummaryrefslogtreecommitdiff
path: root/cmake/modules
diff options
context:
space:
mode:
authorfuzzard <fuzzard@kodi.tv>2022-01-08 08:06:56 +1000
committerfuzzard <fuzzard@kodi.tv>2022-01-08 10:47:44 +1000
commit8689eda2edfdfa0d7343873a1ae3b9a377664b1a (patch)
treedfc96159a561cafe4e960059142833669e70fbd4 /cmake/modules
parent1c8dfa1560669040c0f0857028ed300668adb3ea (diff)
[cmake] Module Fmt use version helper
Diffstat (limited to 'cmake/modules')
-rw-r--r--cmake/modules/FindFmt.cmake9
1 files changed, 5 insertions, 4 deletions
diff --git a/cmake/modules/FindFmt.cmake b/cmake/modules/FindFmt.cmake
index b426d8c779..e50bd8b379 100644
--- a/cmake/modules/FindFmt.cmake
+++ b/cmake/modules/FindFmt.cmake
@@ -14,15 +14,16 @@
if(ENABLE_INTERNAL_FMT)
include(ExternalProject)
- file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/target/libfmt/Makefile VER REGEX "^[ ]*VERSION[ ]*=.+$")
- string(REGEX REPLACE "^[ ]*VERSION[ ]*=[ ]*" "" FMT_VERSION "${VER}")
+ include(cmake/scripts/common/ModuleHelpers.cmake)
+
+ get_archive_name(libfmt)
# allow user to override the download URL with a local tarball
# needed for offline build envs
if(FMT_URL)
get_filename_component(FMT_URL "${FMT_URL}" ABSOLUTE)
else()
- set(FMT_URL http://mirrors.kodi.tv/build-deps/sources/fmt-${FMT_VERSION}.tar.gz)
+ set(FMT_URL http://mirrors.kodi.tv/build-deps/sources/${ARCHIVE})
endif()
if(VERBOSE)
message(STATUS "FMT_URL: ${FMT_URL}")
@@ -52,7 +53,7 @@ if(ENABLE_INTERNAL_FMT)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Fmt
REQUIRED_VARS FMT_LIBRARY FMT_INCLUDE_DIR
- VERSION_VAR FMT_VERSION)
+ VERSION_VAR FMT_VER)
set(FMT_LIBRARIES ${FMT_LIBRARY})
set(FMT_INCLUDE_DIRS ${FMT_INCLUDE_DIR})