cmake: look for fmtlib system pkg first
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-01-14 04:48:48 +01:00
parent a2020d212d
commit ad71199e1a
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

View File

@ -41,7 +41,21 @@ if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
endif()
endif()
add_subdirectory(lib/fmt EXCLUDE_FROM_ALL)
message(STATUS "Looking for fmt::fmtlib system pkg")
find_package(fmt QUIET)
if(NOT fmt_FOUND)
message(WARNING "fmt::fmtlib system pkg not found, checking for submodule")
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lib/fmt/CMakeLists.txt")
message(FATAL_ERROR "fmt::fmtlib submodule is apparently missing from
${CMAKE_CURRENT_SOURCE_DIR}/lib/fmt, please checkout submodules")
else()
message(STATUS "Using fmt::fmtlib submodule")
add_subdirectory(lib/fmt EXCLUDE_FROM_ALL)
endif()
else()
message(STATUS "Found fmt::fmtlib")
endif()
add_subdirectory(lib/fmtlog EXCLUDE_FROM_ALL)
add_subdirectory(lib/da_threading EXCLUDE_FROM_ALL)