cmake: look for fmtlib system pkg first
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
a2020d212d
commit
ad71199e1a
|
@ -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)
|
||||
|
||||
|
|
Reference in New Issue