diff options
author | fuzzard <fuzzard@kodi.tv> | 2022-01-08 08:09:12 +1000 |
---|---|---|
committer | fuzzard <fuzzard@kodi.tv> | 2022-01-08 10:47:44 +1000 |
commit | d9bebcfaada189ae51cbd259758351b8add1b11a (patch) | |
tree | 56fa4d29fa561aa7cef7e54c82b6266cb1faee35 | |
parent | 177e94b99897ecd7bd038d36b8bb0af1182c3f0c (diff) |
[cmake] Module spdlog use VERSION helper
-rw-r--r-- | cmake/modules/FindSpdlog.cmake | 8 | ||||
-rw-r--r-- | tools/depends/target/libspdlog/LIBSPDLOG-VERSION | 3 | ||||
-rw-r--r-- | tools/depends/target/libspdlog/Makefile | 9 |
3 files changed, 10 insertions, 10 deletions
diff --git a/cmake/modules/FindSpdlog.cmake b/cmake/modules/FindSpdlog.cmake index 6df9f64645..685556de90 100644 --- a/cmake/modules/FindSpdlog.cmake +++ b/cmake/modules/FindSpdlog.cmake @@ -15,15 +15,17 @@ if(ENABLE_INTERNAL_SPDLOG) include(ExternalProject) - file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/target/libspdlog/Makefile VER REGEX "^[ ]*VERSION[ ]*=.+$") - string(REGEX REPLACE "^[ ]*VERSION[ ]*=[ ]*" "" SPDLOG_VERSION "${VER}") + include(cmake/scripts/common/ModuleHelpers.cmake) + + get_archive_name(libspdlog) + set(SPDLOG_VERSION ${SPDLOG_VER}) # allow user to override the download URL with a local tarball # needed for offline build envs if(SPDLOG_URL) get_filename_component(SPDLOG_URL "${SPDLOG_URL}" ABSOLUTE) else() - set(SPDLOG_URL http://mirrors.kodi.tv/build-deps/sources/spdlog-${SPDLOG_VERSION}.tar.gz) + set(SPDLOG_URL http://mirrors.kodi.tv/build-deps/sources/${ARCHIVE}) endif() if(VERBOSE) message(STATUS "SPDLOG_URL: ${SPDLOG_URL}") diff --git a/tools/depends/target/libspdlog/LIBSPDLOG-VERSION b/tools/depends/target/libspdlog/LIBSPDLOG-VERSION new file mode 100644 index 0000000000..46a5037af0 --- /dev/null +++ b/tools/depends/target/libspdlog/LIBSPDLOG-VERSION @@ -0,0 +1,3 @@ +LIBNAME=spdlog +VERSION=1.9.2 +ARCHIVE=$(LIBNAME)-$(VERSION).tar.gz diff --git a/tools/depends/target/libspdlog/Makefile b/tools/depends/target/libspdlog/Makefile index 3d55e91f20..195d4caae4 100644 --- a/tools/depends/target/libspdlog/Makefile +++ b/tools/depends/target/libspdlog/Makefile @@ -1,11 +1,6 @@ -include ../../Makefile.include -DEPS = Makefile - -# lib name, version -LIBNAME=spdlog -VERSION=1.9.2 -SOURCE=$(LIBNAME)-$(VERSION) -ARCHIVE=$(SOURCE).tar.gz +include LIBSPDLOG-VERSION +DEPS = Makefile LIBSPDLOG-VERSION CMAKE_OPTIONS= \ -DSPDLOG_BUILD_EXAMPLE=OFF \ |