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.15.3 GIT_SHALLOW TRUE ) set(SPDLOG_FMT_EXTERNAL ON CACHE BOOL "" FORCE) FetchContent_MakeAvailable(spdlog) #add_definitions(-DSPDLOG_FMT_EXTERNAL)