include(FetchContent) if(NOT DEFINED SPDLOG_REPO) set(SPDLOG_REPO https://github.com/gabime/spdlog.git) endif () FetchContent_Declare( spdlog EXCLUDE_FROM_ALL GIT_REPOSITORY ${SPDLOG_REPO} GIT_TAG v1.14.1 GIT_SHALLOW TRUE ) option(SPDLOG_FMT_EXTERNAL "" ON) FetchContent_MakeAvailable(spdlog) #add_definitions(-DSPDLOG_FMT_EXTERNAL)