ExternalProject_Add(fmt URL https://github.com/fmtlib/fmt/archive/refs/tags/8.1.1.tar.gz #CMAKE_ARGS -DEVENT__LIBRARY_TYPE:STRING=STATIC INSTALL_COMMAND "" CONFIGURE_COMMAND cmake -DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/toolchain.cmake BUILD_COMMAND make fmt ) ExternalProject_Get_property(fmt BINARY_DIR) set(FMT_BINARY_DIR ${BINARY_DIR}) ExternalProject_Get_property(fmt SOURCE_DIR) set(FMT_SRC_DIR ${SOURCE_DIR}) include_directories(${FMT_SRC_DIR}/include) link_directories(${FMT_BINARY_DIR}) link_libraries(fmt.a)