###### FMT ######
set(FMT_INSTALL_DIR ${EXTERNAL_INSTALL_LOCATION}/fmt)
set(FMT_INCLUDE_DIR ${FMT_INSTALL_DIR}/include)
set(FMT_LIB_DIR ${FMT_INSTALL_DIR}/lib)

set(FMT_EXTRA_CXX_FLAGS "-fPIC")

ExternalProject_Add(fmt
  PREFIX ${FMT_INSTALL_DIR}
  INSTALL_DIR ${FMT_INSTALL_DIR}
  GIT_REPOSITORY https://github.com/fmtlib/fmt.git
  GIT_TAG "8.1.0"
  CMAKE_ARGS
  -DCMAKE_INSTALL_PREFIX:PATH=${FMT_INSTALL_DIR}
  -DCMAKE_CXX_FLAGS=${FMT_EXTRA_CXX_FLAGS}
  )

set(FMT_FOUND TRUE)
set(FMT_INCLUDE_DIRS ${FMT_INSTALL_DIR}/include)
set(FMT_LIBRARIES ${FMT_INSTALL_DIR}/lib/libfmt.a)
set(FMT_LIBRARY_DIRS ${FMT_INSTALL_DIR}/lib)
set(FMT_EXTERNAL TRUE)

include_directories(${FMT_INCLUDE_DIRS})
link_directories(${FMT_LIBRARY_DIRS})

list(APPEND EXTERNAL_INCLUDES PUBLIC ${FMT_INCLUDE_DIRS})
list(APPEND EXTERNAL_LIBS PUBLIC ${FMT_LIBRARIES})

list(APPEND EXTERNAL_DEPENDENCIES fmt)
