Support build with system fmt (#3838)

Signed-off-by: Yuri Konotopov <ykonotopov@gnome.org>
This commit is contained in:
Yuri Konotopov 2020-11-09 04:28:43 +04:00 committed by GitHub
parent 12c21de66c
commit 64010cf797
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 5 deletions

View File

@ -41,11 +41,6 @@ if(NOT NO_TRANSLATION)
endif()
endif()
# 3rdpary Libraries
if(EXISTS "${CMAKE_SOURCE_DIR}/3rdparty/fmt/fmt")
add_subdirectory(3rdparty/fmt/fmt)
endif()
# make common
if(common_libs)
add_subdirectory(common/src/Utilities)

View File

@ -242,3 +242,15 @@ if((GCC_VERSION VERSION_EQUAL "9.0" OR GCC_VERSION VERSION_GREATER "9.0") AND GC
Even with that patch, compiling with LTO may still segfault. Use at your own risk!
This text being in a compile log in an open issue may cause it to be closed.")
endif()
find_package(fmt "7.0.3" QUIET)
if(NOT fmt_FOUND)
if(EXISTS "${CMAKE_SOURCE_DIR}/3rdparty/fmt/fmt/CMakeLists.txt")
message(STATUS "No system fmt was found. Using bundled")
add_subdirectory(3rdparty/fmt/fmt)
else()
message(FATAL_ERROR "No system or bundled fmt was found")
endif()
else()
message(STATUS "Found fmt: ${fmt_VERSION}")
endif()